To be identified, visitors should have already clicked on a link hook before visiting your web page.
Add the following code to your site's templates.
The code should be added near the top of the tag, before any other script or CSS tags.
<script src="https://static.stnt.co/analytics.min.js"></script>
Page view hits can be sent using the track
command and specifying a hitType
of page-view
.
The track command has the following signature:
stnt.track('trackingId', 'hitType', 'pageUrl');
The following table summarizes the primary fields relevant to tracking page views.
Field | Data type | Required | Description |
| String | Yes | Your tracking ID. Should look like |
| String | Yes | The type of hit. Page view hit should be |
| String | Yes | URL of the page being tracked. Can be absolute or relative. |
The following command sends a page-view
hit and includes the path of the current page:
stnt.track('STNT-XXXXXXXXXX-Y', 'page-view', document.location.href);