Can't save Google's Tag Manager CSS
-
Following Google’s instructions, I have to save this code in the header.php:
<!– Global site tag (gtag.js) – Google Analytics –>
https://www.googletagmanager.com/gtag/js?id=UA-215723764-1
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());gtag(‘config’, ‘UA-215723764-1’);
</script>However, when I save that code WordPress only saves this:
window.dataLayer = window.dataLayer || [];
function gtag() {
}It simply ignores the rest of the code. Of course, when I try to connect via Google it tells me something’s wrong. What do I do here?
The blog I need help with is: (visible only to logged in users)
-
Hi there,
To be able to use that code on your site you’ll need to upgrade to our Business or eCommerce plan. Those are the only plans that allow you the use of such code. You can read more here:
https://wordpress.com/support/code/
Also, if you want to set up Google Tag Manager it’s best to use a plugin to insert that code. You can find more information here:
https://www.wpbeginner.com/beginners-guide/how-to-install-and-setup-google-tag-manager-in-wordpress/
- The topic ‘Can't save Google's Tag Manager CSS’ is closed to new replies.