Install the web snippet
Add My Journey Analytics to your website with one snippet, find your project token and check that events are arriving.
The web snippet is the quickest way to start. It loads the JavaScript library, records pageviews and clicks automatically, and makes session replay, heatmaps and surveys available on your site.
Before you start
You need:
- access to your workspace in the app (for the Australian region,
https://app.myjourneyanalytics.com); - a way to edit the HTML of every page on your site, either directly or through your site builder or tag manager.
1. Copy your snippet
- Sign in to the app.
- Open Settings → Project → General.
- Under SDK setup, choose Web and copy the snippet.
The snippet in the app is already filled in for your project: it contains your project token and the address of your data region, so copy it rather than typing it out.
2. Add it to every page
Paste the snippet inside the <head> of your site, so it is included on every page. Its shape looks like this:
<head>
<!-- ... your existing tags ... -->
<script>
/* Paste the snippet from Settings → Project → General here.
It loads the library and starts it with your project token
and your region's address, for example
https://app.myjourneyanalytics.com for the Australian region. */
</script>
</head>Most site builders and tag managers have a place for custom code in the head of every page; put the snippet there. For Google Tag Manager, follow Install with Google Tag Manager. To send events from a server-side Tag Manager container, see Server-side Google Tag Manager.
The snippet works in single-page apps too: it records a pageview each time your app's router changes the page.
3. Check that events are arriving
- Open your website in a browser and visit a few pages.
- In the app, open Activity. The Live tab lists events as they arrive, and the Events tab lets you search them.
- You should see a pageview for each page you visited.
If nothing appears:
- confirm the snippet is on the page you visited (view the page source and search for your project token);
- turn off ad blockers or privacy extensions in your test browser, or set up a custom tracking domain;
- check your site's content security policy allows scripts from, and requests to, your region's address;
- make sure the snippet was copied from the project you are looking at;
- if you are testing on
localhost, your visits are marked as an internal test user, so insights that filter out internal and test users leave them out.
Next steps
Can't find what you need? Contact support