Add Google Tag Manager to /users/sign_in/ on SaaS
What does this MR do and why?
This MR is a part of gitlab-com/marketing/digital-experience/buyer-experience#990 (moved), specifically, we are adding Google Tag Manager to the /users/sign_in/
path on GitLab.com. It follows the conventions and uses tools set up in !38395 (merged).
I updated the spec for this view to check for the changes as well.
Screenshots or screen recordings
This is a screenshot of my local GDK working with gitlab_gtm_enabled
and the Google Tag Manager config set up:
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Set
GITLAB_SIMULATE_SAAS=1
in your environment to make GDK act as SaaS, since this change only affects SaaS and requires it to render Google Tag manager. - 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.
- 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'
- Start or restart your GDK
-
bundle exec rails c
to open the Rails console and enable a feature flag: - Turn on
Feature.enable(:gitlab_gtm_datalayer)
- Open the Google Tag Assistant
- Visit
http://localhost:3000/users/sign_in/
from the Tag Assistant - You should see the tag assistant connect, it'll look similar to the screenshot posted above.
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.
Edited by Tyler Williams