[Feature flag] Enable GitLab specific Google Tag Manager dataLayer events
Summary
This issue is to rollout GitLab specific GTM dataLayer on production. For now it will only add the Free Trial events, but as we add more, they will be enabled with this flag.
that is currently behind the gitlab_gtm_datalayer ops feature flag, which was added in !76305 (merged)
This feature is related to the gtm_nonce ops flag: #346322 (closed)
It is a part of this epic: Instrument Google Analytics and Bizible on Free Trial and Ecomm Flows
This is a SaaS only feature running behind an ops feature flag, as such won't be part of a self-managed release.
Owners
- Team: Digital Experience
- Most appropriate slack channel to reach out to:
#digital_experience - Best individual to reach out to: @tywilliams
Stakeholders
Instrumentation team Marketing Analytics and Data
Expectations
What are we expecting to happen?
The GitLab-specific Google Tag Manager events will be added to window.dataLayer across the product, as per the specifications in this document provided by external consultants.
Future iterations will add additional events to the dataLayer as well, protected behind this flag.
When is the feature viable?
We need to have OneTrust and Google Tag Manager enabled on production, which we already do:
What might happen if this goes wrong?
If this doesn't work, we might see errors related to pushing to undefined with window.dataLayer, but I think those cases are covered by error logging already.
Or perhaps self-managed installations would start trying to push to that object in the window.
The related MR for this code is !76305 (merged) if we absolutely need to rollback.
What can we monitor to detect problems with this?
Consider mentioning checks for 5xx errors or other anomalies like an increase in redirects (302 HTTP response status)
It's not clear to me, but I think whatever captures errors from import { logError } from '~/lib/logger';, or whatever is capturing errors in the JS console.
What can we check for monitoring production after rollouts?
Consider adding links to check for Sentry errors, Production logs for 5xx, 302s, etc.
Rollout Steps
Rollout on non-production environments
- Ensure that the feature MRs have been deployed to non-production environments.
-
/chatops run auto_deploy status 214ccaa541a4bf585c5adf69798cf635e44d3937
-
-
Enable the feature globally on non-production environments. -
/chatops run feature set gitlab_gtm_datalayer true --dev -
/chatops run feature set gitlab_gtm_datalayer true --staging
-
-
Verify that the feature works as expected. Posting the QA result in this issue is preferable.
Specific rollout on production
- Ensure that the feature MRs have been deployed to both production and canary.
-
/chatops run auto_deploy status 214ccaa541a4bf585c5adf69798cf635e44d3937
-
Preparation before global rollout
-
Check if the feature flag change needs to be accompanied with a change management issue. Cross link the issue here if it does. -
Ensure that you or a representative in development can be available for at least 2 hours after feature flag updates in production. If a different developer will be covering, or an exception is needed, please inform the oncall SRE by using the @sre-oncallSlack alias. -
Ensure that documentation has been updated (More info). -
Announce on the feature issue an estimated time this will be enabled on GitLab.com. -
Notify #support_gitlab-comand your team channel (more guidance when this is necessary in the dev docs).
Global rollout on production
For visibility, all /chatops commands that target production should be executed in the #production slack channel and cross-posted (with the command results) to the responsible team's slack channel (#digital-experience-team).
-
Incrementally roll out the feature. - If the feature flag in code does NOT have an actor, perform time-based rollout (random rollout).
-
/chatops run feature set gitlab_gtm_datalayer <rollout-percentage>
-
- Enable the feature globally on production environment.
-
/chatops run feature set gitlab_gtm_datalayer true
-
- If the feature flag in code does NOT have an actor, perform time-based rollout (random rollout).
-
Announce on the feature issue that the feature has been globally enabled. -
Wait for at least one day for the verification term.
Rollback Steps
-
This feature can be disabled by running the following Chatops command:
/chatops run feature set gitlab_gtm_datalayer false