-
Notifications
You must be signed in to change notification settings - Fork 57
Adding aggregated engagement tracking to snowplow.js #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for snowplow-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
TODOBefore this can be merged, a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs tidying up from testing but otherwise lgtm
@@ -43,6 +78,7 @@ const createTrackerConfig = (cookieName) => { | |||
cookieDomain: `.${domain[1]}.${domain[0]}`, | |||
cookieName, | |||
cookieSameSite: 'Lax', | |||
keepalive: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an important point. It uses the keep alive functionality of the Fetch API that means even after a window is closed or you've navigated away, the browser will still complete the request. This was the problem with the Beacon API which made this entire aggregated page ping logic so flaky, and why I want to try this method out.
@@ -64,16 +100,18 @@ const createTrackerConfig = (cookieName) => { | |||
const setupBrowserTracker = () => { | |||
newTracker( | |||
'snplow5', | |||
'https://collector.snowplow.io', | |||
// 'https://collector.snowplow.io', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix these commented out bits please
No description provided.