Skip to content

Add Google Analytics ID to gitlab_standard schema

Axel García requested to merge 335067-add-ga-id-to-gitlab-standard-schema into master

What does this MR do and why?

Related to #335067

Google Analytics ID is set as a cookie when a user visits the marketing site, as it's a TLD level cookie (*.gitlab.com). This MR appends this string to Snowplow events that have the gitlab_standard schema attached to them (structured events, page views), using the new google_analytics_id field.

Screenshots

Google Analytics ID in the standard_context data, for a page view event

image

How to set up and validate locally

Example below:

  1. Follow the instructions in our docs to enable Snowplow locally, if you haven't done so.
  2. Set a cookie called _ga with the method you prefer and any test value.
    // In the browser console, for example
    cookieStore.set('_ga', 'GA1.2.345678901.234567891')
  3. Trigger any Snowplow event. Like a page view by reloading the page.
  4. Verify the Snowplow testing tool of your choice and you'll be able to see this value in the gitlab_standard context.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Axel García

Merge request reports