Dear All,
I’m trying to correctly implement Google Tag Manager onto my website.
I’m currently trying the Metronet Tag Manager plugin and have copied and pasted my code into the required place in the plugin settings.
Using Google’s Tag Assistant, I can see that it’s on the website (on every page) but the Google Analytics tag inside the Tag Manager doesn’t seem to work. I’ve checked back through my settings in Google Tag Manager and am certain that it’s inserted correctly and is publishing.
It seems there is lots of information about adding some code here and there in my WordPress, Origami site to make it work properly but it’s all a bit over my head. Is anyone able to help out?
Thanks.
Hi Kiel
Thanks for reaching out.
Have you perhaps looked at using a plugin to help with this? Here are a few to consider:
https://wordpress.org/plugins/tags/google-tag-manager
Alternatively, please let me know which snippets / scripts Google is suggesting be inserted into the site, we can help implement those correctly.
Hi Andrew,
I’m currently using the first plugin on that link and have also tried Duracell’s plugin too. The Metronet plugin put the code on all of my pages but it doesn’t seem to have the Analytics code in it / it isn’t working. With Duracell’s, it only seems to add it to the homepage and doesn’t get copied to other pages.
Here’s the code I’m trying to put in from GTM
(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=
‘//www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,’script’,’dataLayer’,’GTM-TTHFQ9′);
Thanks again for the help
Actually, the code above looks different after pasting it!
Hi Keil
Please use the code tags identified under the comment box at the bottom of this page. This will keep your code formatting intact. WordPress strips html tags out by default.
Hope this helps
Magus
Thanks Keil
Ok, so two options then. You add another plugin to handle Google Analytics. It’s a little old, but I like this plugin for it’s simplicity:
https://wordpress.org/plugins/googleanalytics/
For something more fully fledged try:
https://wordpress.org/plugins/google-analytics-for-wordpress/
Option two is you use the plugin Header and Footer scripts:
https://wordpress.org/plugins/header-and-footer-scripts/
That’ll let you manually insert your own scripts into the header or footer.