Analytics plugin from pro does not work

Hello,

I’ve tried to use the google analytics plugin from pro but somehow it doesn’t work. Until now it always worked but now with the new site it doesn’t.

What happens is the following:

I paste the tracking code in the plugin.

script async src=“https://www.googletagmanager.com/gtag/js?id=UA-20915236-15”>
script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());

gtag(‘config’, ‘UA-20915236-15’);

And when I hit update the first of the 2 scripts gets deleted. So it ends up with this code:

script>/script>
script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());

gtag(‘config’, ‘UA-20915236-15’);

I have deliberedly removed the fist < symbols for the script otherwise it disappears in the message. On my side this I correct. My site is www.dutchjuggler.com I hope you can help quick because I would like to see what happens now after I’ve updated the site.

with regards,

Jeroen

Hello Jeroen,

Thanks for writing in!

Please be advised that the Pro > Theme Options > Custom JS section will only accept valid javascript code. You are not allowed to insert any code especially having the <script></script> because it will just result to an error. Please install “Insert Headers and Footers” plugins. Once installed, go to Settings > Insert headers and footers > header. This is where you insert your analytics code.

We would love to know if this has worked for you. Thank you.

hello I do not understand your answer because I use the plugin which is included in the pro theme download. So this plugin is especially for the cause of the script from google analytics or am I mistakting?

with regards,

jeroen

Hi Jeroen,

Are you referring to the Google Analytics extension? Please make sure it is updated, then you don’t need to paste the entire script. You only need to have the Tracking ID.

Please review the Google Analytics extension documentation here.

Hope it helps,
Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.