• Resolved m22687

    (@m22687)


    Hi

    I used to use GAWP but since they moved to Exact Metrics I felt it was too heavy going and installed GA Analytics instead.

    Now to check I installed GA debug and GA Tag manager chrome extensions and I found one instance of Analytics but page views are apparently firing twice.

    The second is an instance of a global site tag or gtag installed and for the life of me, I cannot find how that was installed as GA Analytics is the only tracker. I have checked Tag Manager admin and nothing there and no GTAG installed in the theme or linked in GA admin.

    Note cleared the cache (WP rocket etc. Still there.

    Wondering if you can take a look and see where the issues might be? It would be a massive help

    Thanks

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Currently I am seeing only one instance of GA tracking code on your pages (I checked a few different pages). The issue could be from caching, or could be a conflict with another plugin or even your theme, difficult to know without testing stuff, etc. Best advice is to troubleshoot your plugins and also look at if your theme is doing anything with/for analytics stuff. Also inspect your site error log if there are any related errors or warnings.

    Thread Starter m22687

    (@m22687)

    Thanks Jeff, just wondering why tag manager is saying the page view is firing twice?

    Nothing in the theme as far as I can see.

    Plugin Author Jeff Starr

    (@specialk)

    I’m not sure, but one thing to look at is compare the code output by your site:

    <script>(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://headfonics.com/wp-content/cache/busting/google-tracking/ga-871c39943ac31c498d591a714a31212c.js','ga');
    	ga('create', 'UA-22774929-1', 'auto');
    	ga('send', 'pageview');
    </script>

    Notice the “cache/busting” URL? Now compare with the normal tracking code:

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

    So it looks like something has changed the URL of the google tracking script.

    Thread Starter m22687

    (@m22687)

    INteresting – I use WP Rocket

    I found this link – would it help to explain the change? Note v3.6 they refer to is about to hit the update but not yet.

    https://docs.wp-rocket.me/article/1103-google-tracking-add-on

    https://docs.wp-rocket.me/article/56-remove-query-string-from-static-resources

    • This reply was modified 3 years, 10 months ago by m22687.
    Plugin Author Jeff Starr

    (@specialk)

    Yeah I never use WP Rocket for anything so have no idea tbh.

    I would maybe ask in their support forum, someone’s gotta know.

    Plugin Author Jeff Starr

    (@specialk)

    Hey @m22687, I hope you got this sorted. It’s been awhile with no reply so gonna go ahead and mark this thread as resolved to help keep the forum organized. Feel free to post again with any further questions or feedback, Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Duplicate Analytics page views’ is closed to new replies.