Add Free Trial dataLayer specification
What does this MR do and why?
Closes: gitlab-com/marketing/digital-experience/buyer-experience#212 (closed)
This MR adds the specified Google Tag Manager dataLayer events as outlined by Empirical Path. The events are gated behind an ops flag so we can enable it on GitLab.com
specifically.
Based on the approval guidelines, I believe I need the following:
-
Approval by a backend maintainer since this MR makes changes to some controllers. -
Approval by a frontend maintainer, since this MR makes changes to views and JavaScript. -
Approval by a Product Intelligence engineer, since this MR includes analytics changes. -
Approval by a Quality maintainer or Quality reviewer since this MR includes additional feature specs.
Screenshots or screen recordings
Watch the local verification video
How to set up and validate locally
Manual verification
- Create a Google Tag Manager account and container ID. You should just need to follow the step 1 of the instructions. The GTM container can be empty - it just needs to exist.
- Enable the
gitlab_gtm_datalayer
feature flagFeature.enable(:gitlab_gtm_datalayer)
- In
gitlab.yml
, add a your GTM ID in theextra
block for both thegoogle_tag_manager_id
andgoogle_tag_manager_nonce_id
values. Make sure to restart GDK (or do this step prior to starting GDK) for settings to take effect.extra: google_tag_manager_id: 'GTM-YOURIDHERE' google_tag_manager_nonce_id: 'GTM-YOURIDHERE'
- Open the Google Tag Assistant and point it to /-/trial_registrations/new
- Step through the Empirical Path dataLayer specification
- For each step, check the
dataLayer
tag in the tag assistant and verify the events are firing. Watch the local verification video to see how to check that.
Feature spec
I've added a feature spec at ee/spec/features/google_analytics_datalayer_spec.rb
, but it requires JavaScript to run, which means you'll need to do the workaround for current bugs in your local environment. More info in #342765.
In app/assets/javascripts/lib/utils/webpack.js
, comment out __webpack_public_path__ = webpackAssetPath; // eslint-disable-line babel/camelcase
.
Then you can run the feature spec at that file.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
I need to do step 3 of Deployment:
I have informed the Infrastructure department of a default setting or new setting change per definition of done, or decided that this is unnecessary.