Making WordPress.org

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's profile 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)

#1 @Otto42
5 years ago

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.

#2 @jonoaldersonwp
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>

#3 @SergeyBiryukov
5 years ago

  • Component changed from General to Slack & IRC

#4 @dd32
5 years ago

In 9195:

WordPress.org: Load Google Tag Manager through an mu-plugin rather than loading it manually in many themes.

See #4625.

#5 @dd32
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.