Skip to content

Commit 957a8c9

Browse files
feat: add GTM injection to prod
1 parent e2b6073 commit 957a8c9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

k8s.prod/app-ingress.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ metadata:
1212
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
1313
# allow requests larger than 1MiB
1414
nginx.ingress.kubernetes.io/proxy-body-size: "0"
15+
nginx.ingress.kubernetes.io/configuration-snippet: |
16+
# Inject Google Tag Manager:
17+
18+
proxy_set_header Accept-Encoding ""; # upstream compression must be disabled
19+
20+
sub_filter '</head>' '<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({"gtm.start": new Date().getTime(),event:"gtm.js"});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!="dataLayer"?"&l="+l:"";j.async=true;j.src="https://www.googletagmanager.com/gtm.js?id="+i+dl;f.parentNode.insertBefore(j,f); })(window,document,"script","dataLayer","GTM-KBZ6ZKX");</script></head>';
21+
22+
sub_filter '</body>' '<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KBZ6ZKX" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript></body>';
1523
spec:
1624
tls:
1725
- hosts:

0 commit comments

Comments
 (0)