Add google tag manager nonce config to gitlab chart
What does this MR do?
Enabled to add GTM ID to our config. Adding this ID is part of a customer-critical-merge-request: gitlab-org/gitlab!58494 (comment 740556436)
- Rollout issue: gitlab-org/gitlab#346322 (closed)
- MR introducing GTM with the nonce version and the Feature Flag gitlab-org/gitlab!58494 (merged) Related: gitlab-com/gl-infra/k8s-workloads/gitlab-com!1369 (diffs, comment 744923376)
- Staging config: gitlab-com/gl-infra/k8s-workloads/gitlab-com!1369 (comment 744923376)
How to Test
- Install overriding the site URL:
$ h upgrade --install gitlab . \
   --set global.hosts.domain=<local_ip>.nip.io \ 
   --set global.appConfig.extra.googleTagManagerNonceId='GTM-NJXWQL' \
   --set global.hosts.gitlab.name=gitlab.com  \
   -f examples/kind/values-base.yaml -f examples/kind/values-ssl.yaml- Override host name:
echo "gitlab.com <local_ip>" >> /etc/hosts- turn on feature flag:
/srv/gitlab/bin/rails console
Feature.enable(:gtm_nonce)- use curl to confirm (we have to ignore SSL cert issues completely and browsers are not quite willing to do that):
$ curl -s -k -L https://gitlab.com/users/sign_up | grep google
'https://www.googletagmanager.com/gtm.js?id='+i+dl;var n=d.querySelector('[nonce]');
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NJXWQL"Related issues
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion.
Required
- 
Merge Request Title and Description are up to date, accurate, and descriptive 
- 
MR targeting the appropriate branch 
- 
MR has a green pipeline on GitLab.com 
Expected (please provide an explanation if not completing)
- 
Test plan indicating conditions for success has been posted and passes 
- 
Documentation created/updated 
- 
Tests added 
- 
Integration tests added to GitLab QA 
- 
Equivalent MR/issue for omnibus-gitlab opened gitlab-org/omnibus-gitlab!5763 (merged) 
Edited  by Nicolas Dular