Skip to content

Add Free Trial dataLayer specification

Tyler Williams requested to merge add-free-trial-datalayer-analytics into master

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:

  1. Approval by a backend maintainer since this MR makes changes to some controllers.
  2. Approval by a frontend maintainer, since this MR makes changes to views and JavaScript.
  3. Approval by a Product Intelligence engineer, since this MR includes analytics changes.
  4. 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

  1. 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.
  2. Enable the gitlab_gtm_datalayer feature flag
    Feature.enable(:gitlab_gtm_datalayer)
  3. In gitlab.yml, add a your GTM ID in the extra block for both the google_tag_manager_id and google_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'
  4. Open the Google Tag Assistant and point it to /-/trial_registrations/new
  5. Step through the Empirical Path dataLayer specification
  6. 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 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.

Edited by Tyler Williams

Merge request reports