Before you start
You need permission to publish the site, and your workspace ID. Open Settings → Install to find the snippet. A new workspace also shows it on Overview until the first event arrives.Install the snippet
Put the snippet on every page, not only the confirmation page. We connect a conversion to a campaign using the landing visit, so without that visit the conversion arrives with no campaign.1
Copy your snippet
Open Settings → Install and copy the snippet. Your workspace ID is already in it.
2
Paste it in the head
Add it inside
<head>, before the closing </head> tag. Use your shared template.3
Publish the site
A draft or local change cannot send production visits.
4
Visit the published page
Use a private window. The test then starts with a new visitor and session.
Where to put it
Install with npm instead
Use the package when your application controls its own JavaScript lifecycle.What you get without more code
The snippet sends apageview event when the page loads, and again on every route change
in a single-page application.
Each event carries the URL, referrer, campaign parameters, ad click IDs, browser context,
and session data. For the exact parameters captured, see
Attribution in the Web SDK.
Nothing else is automatic. The SDK does not track clicks, scrolls, form submits, or
outbound links. There is no separate session event, because session data rides on every
event.
To record what matters to your business, add two things:
Verify
- Open the published page in a private window.
- Open Events in Datalyr.
- Find a
pageviewwith the URL you visited. It arrives within 30 seconds.
Finding
dl.js in the page source proves only that the tag published. The install is
complete when the event appears in Events.When no event arrives
A wrong workspace ID returns a
4xx response, and the SDK drops the batch without
retrying. Nothing appears in either workspace.
Next, run the full verification checklist.