Adjusts snowplow to use cookies for sessions
What does this MR do?
It changes the way that snowplow stores session ids. The current behavior is to use local storage, but the challenge comes up with session expiration, which doesn't appear to naturally happen in snowplow by default.
Closes https://gitlab.com/gitlab-org/telemetry/issues/77
This also restructures where the configuration for snowplow lives, which will give us some flexibility with adding new features behind feature flags as we roll out new tracking behaviors.
CE MR - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/32236 Original MR that was reverted - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31826
Does this MR meet the acceptance criteria?
Changelog: I've not created a changelog entry, but let me know if there should be one
Conformity
- [-] Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios.
-
Documentation created/updated or follow-up review issue created - [-] Code review guidelines
-
Merge request performance guidelines - [-] Style guides
- [-] Database guides
- [-] Separation of EE specific content
Performance and Testing
I've changed the timing for when snowplow('enableActivityTracking', 30, 30)
and snowplow('trackPageView')
are called. They're now on DOM ready, which may improve tracking, but may also impact the performance negatively (before they weren't really doing much, as far as I can tell). I've kept these behind a feature flag, so we should be able to roll this out and figure that out, but I'm open to ideas/guidance here.