Jump to content
thirty bees forum
  • 0

Custom Code Not Working


spidawebs

Question

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?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

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

No, it's not appearing in the front.

Link to comment
Share on other sites

  • 0

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’); //–><!]]>

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

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...