• Resolved jlhsolutions

    (@jlhsolutions)


    Hello,

    I added my Google Analytics code to the Under Construction plugin and now I am getting some code showing up at the top of my page. I just updated to the new version and I was hoping this was fixed, but I still have the code showing up.

    (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-181859409-1', 'auto'); ga('send', 'pageview');

    What do I need to do to hide this? Also, it does not seem to be tracking when people hit my site.

    Please advise how to fix this.
    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Alexandru Tapuleasa

    (@talextech)

    Unfortunately the contents on the Content field are passed through wp_kses() in order to adequately escape user input as required by WordPress and consequently <script> tags will be escaped and anything inside the tags will simply appear on the page as normal text 😕
    We understand this is far from ideal and will try to find some way around it in the future releases.

    Thread Starter jlhsolutions

    (@jlhsolutions)

    So is there a reason that the analytics aren’t showing up when people hit the under-construction page?

    I’ve also seen this showing up on the login page.
    Under Construction Mode is <b>enabled</b>.

    Plugin Author Alexandru Tapuleasa

    (@talextech)

    Well, the tracking code is just interpreted as text and will not actually track anything 🙁

    As for the login page, that’s a bug as <b> tags should work, we’ll get that fixed.

    Thread Starter jlhsolutions

    (@jlhsolutions)

    So the GA tracking code does not work even though it’s advertised that it does? What am I missing here?

    Plugin Author Alexandru Tapuleasa

    (@talextech)

    Yes, but you will need to use the Google Analytics Tracking option in the Main settings tab.

    Thread Starter jlhsolutions

    (@jlhsolutions)

    I did put my GA code there. Then it shows up the error message that I posted in my first post. But when I go to the GA website, it never shows up that ANY traffic is on my site. And according to the response, “Well, the tracking code is just interpreted as text and will not actually track anything” it seems like this feature isn’t working at all.

    Plugin Author Alexandru Tapuleasa

    (@talextech)

    Sorry, I misunderstood you, I though you were adding the JavaScript tracking code yourself 😕
    We have found the issue and have pushed the fix in version 3.92 😊

    Thread Starter jlhsolutions

    (@jlhsolutions)

    I installed the new version. Looks like the GA code is working now as it should. Thank you for that!

    I still see this on the wp-login page.
    Under Construction Mode is <b>enabled</b>.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Code showing up when Google Analytics is enabled’ is closed to new replies.