Jump to content
thirty bees forum

Question

Posted

I've just added my Google Analytics code to the new "Add extra JavaScript to your pages" part of the custom code section, but it's not showing up on the website.

I've cleared the cache. Is there anything else I need to do or is this not working properly?

8 answers to this question

Recommended Posts

  • 0
Posted

Can you take a screenshot of how you added it? I take it as you removed the extra script wrapper, right? Is it displaying in the front? You can share a url if you have it on a server

  • 0
Posted

@Nemo I just added the full code provided by Google Analytics which was:

No, it's not appearing in the front.

  • 0
Posted

Right, the script tag must be removed, I guess we will implement a free html box as well, or parse the js one so that they are automatically removed

What you need to use is just this

<!–//–><![CDATA[//><!– (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,‘script’,‘https://www.google-analytics.com/analytics.js’,'ga’); ga(‘create’, ‘UA-xxxxxx-xx’, ‘auto’); ga(‘send’, ‘pageview’); //–><!]]>

  • 0
Posted

Thanks, but that didn't work either. I checked the Google Analytics code again and actually it should be like this:

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXXX-XX', 'auto'); ga('send', 'pageview');

So I put that in without any script tags and it still won't work.

  • 0
Posted

THat's very odd, we will have it checked. I take it as it's saving and retaining the value in the back office, correct? I wonder if someone accidentally broke the functionality in the front. Are you using the latest build or?

  • 0
Posted

Yes, it is saving and retaining the value. First of all it was displaying errors but as soon as I removed the script tags as you suggested, the errors disappeared. But the tracking code would never appear on the front.

I'm using 1.0.0

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...