Opened 5 years ago
Closed 5 years ago
#4625 closed defect (bug) (fixed)
Slack info page is missing Google Tag Manager code
Reported by: | jonoaldersonwp | Owned by: | |
---|---|---|---|
Milestone: | Priority: | lowest | |
Component: | Communication (Matrix, Slack, IRC) | Keywords: | analytics |
Cc: |
Description
https://make.wordpress.org/chat/ omits our GTM snippet. This should be added.
Change History (5)
#2
@
5 years ago
Same as on other wp.org pages/templates.
In the 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-P24PF4B');</script>
Immediately after the opening body tag:
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P24PF4B" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
#5
@
5 years ago
- Resolution set to fixed
- Status changed from new to closed
$ curl -s https://make.wordpress.org/chat/ | grep tagmanager <link rel='dns-prefetch' href='//www.googletagmanager.com' /> 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P24PF4B" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
Note: See
TracTickets for help on using
tickets.
What is the script code that needs to be added to the head section? This should probably be added to the mu-plugin that enables the rest of the chat page code.