Add myne website tracking to your site
Published
myne can track how people browse your website, record their page views, and keep track of their session. When they later identify themselves—via a connection form or by logging in—myne links all their prior activity to their customer profile.
To start tracking, you need to add one script tag to your website and allow your domains in myne.
Copy your tracking snippet
In myne, go to Settings → Brand → Tracking.
Open Tracking snippet and click Copy. It will look like this (with your write key filled in):
<script src="https://YOUR-HOST/connect/myne.js" data-myne-key="YOUR_WRITE_KEY" async></script>
Keep this key private and do not share it outside your team.
Allow your website domains
On the same Tracking tab, find Allowed domains and add each site where you want to track activity (one per line). Include both the apex domain and www if you use both:
https://example.comhttps://www.example.com
Tracking from a domain that is not on this list will be blocked. Click Save when you have finished.
Add the snippet to your site
Place the script in your site's shared layout so it loads on every page. This is typically just before the closing </head> tag, or in a global header or footer include:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Your site</title>
<!-- myne website tracking -->
<script
src="https://YOUR-HOST/connect/myne.js"
data-myne-key="YOUR_WRITE_KEY"
async
></script>
</head>
<body>
<!-- your page content -->
</body>
</html>
If you use a CMS or page builder, use the site-wide custom code or header HTML field instead of pasting the script on each page:
- WordPress: theme header
- Shopify:
theme.liquid - Squarespace, Webflow, Wix: custom code section
Publish or deploy your changes.
What happens automatically
Once the snippet is live on an allowed domain, myne starts collecting data:
- Visitor sessions: A visitor ID is stored in the browser and sent with every event.
- Page views: myne records each page load, including route changes on single-page apps.
- Cross-site links: External links can carry the visitor ID and UTM parameters, so if someone signs up on another myne page, the session continues.
- Activity in myne: Website events appear as activity on visitor profiles. Once someone identifies themselves, their activity is linked to their customer record.
You do not need additional code for basic page tracking.
Check that it is working
To verify the snippet is active:
- Open your live website in a normal browser tab (not incognito or a private window).
- Browse a few pages.
- In myne, check that new website activity appears for your brand in your activity feed or customer activity view.
If nothing appears: confirm the script is in your page source, that the domain matches your Allowed domains list, and that you are testing the environment that matches your snippet.
Optional: Custom events and identify calls
Once the snippet loads, you can call the myne JavaScript API from your own scripts to record custom actions or identify visitors:
<script>
// Record a meaningful action
myne.event('started_checkout', { plan: 'monthly' });
// Identify when you already know the person
myne.contact({ email: 'alex@example.com' });
// Clear local visitor data on logout
myne.reset();
</script>
Common calls include:
- myne.event("name", { … }): Record custom actions such as viewing pricing, adding to cart, or starting checkout.
- myne.contact({ email / phone / user_id }): Identify the current visitor when you already know who they are (for example, after your own login).
- myne.business({ … }): Link the visitor to a business account (useful for B2B sites).
- myne.reset(): Clear stored visitor data on logout or on shared devices.
If the visitor is already known when the page loads, you can pass their email or phone directly on the script tag using data-myne-email or data-myne-phone, or set window.myneCustomer before the snippet runs. Full API signatures are available on the Tracking tab in Settings.
Turn browser activity into known customers
To link anonymous website browsing to known customer profiles, pair the tracking snippet with a myne connection form on the same domain. When someone submits the form with their email or phone, myne links all their prior page views and events to that person. This way, you capture their full journey from first visit to signup without needing a separate CRM ID pipeline.
See Add a connection form for details.