• Resolved chaff91

    (@chaff91)


    Hi,

    We’re having an issue with the page URL that is sent through to Google Analytics on Ajax loaded posts.

    Current Setup
    We’re using the https://www.ads-software.com/plugins/ajax-load-more/ with the SEO & Previous Post plugins activated.

    Our Google Analytics tracking code is using standard tracking, along with the “displayfeatures” & “linkid” enabled.

    What’s Happening
    When we go to a page within the website, we can see in Google Analytics a page tracked as expected (e.g. /blog-article-1), but when we scroll down for the Ajax load on the next post, the page tracked isn’t sent correctly. Instead of sending /blog-article-2 as expected, it sends /https://www.domain.com/blog-article-2

    We can see this via Google Analytics Real Time report, as well as looking at the Behavior > Site Content > All Pages report.

    Is this something that’s occurring for others, and is there a fix for this?

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi.
    Yes, this is known issue and I will release a fix soon.
    https://www.ads-software.com/support/topic/google-analytics-not-sending-page-views?replies=5

    Plugin Author Darren Cooney

    (@dcooney)

    Hi chaff91,
    Are you using Google Analytics by Yoast for tracking?

    I have an update ready for SEO and Previous post that adds support for Yoast. Yoast replaces the standard ga() function with a custom __gaTracker() function.

    I just want to make sure this will fix things for you.

    Thread Starter chaff91

    (@chaff91)

    Hey,

    We were originally using the Google Analytics by Yoast plugin for the tracking, but after seeing the https://www.ads-software.com/support/topic/google-analytics-not-sending-page-views post, we turned it off & just put it straight into the head.

    Whilst the code is in the head section, this is where we’re seeing this issue occur.

    From what you’re saying, I don’t think they’d be linked, but I’d be happy to test re-enabling Google Analytics by Yoast, and seeing if the tracking URL is being picked up properly.

    Plugin Author Darren Cooney

    (@dcooney)

    Was the tracking working when you turned on GA by Yoast?

    Thread Starter chaff91

    (@chaff91)

    No, not when we were first going. That’s why we disabled it & moved it to the head section.

    Plugin Author Darren Cooney

    (@dcooney)

    Ahh ok,
    Well now both GA by Yoast and standard tracking functions are triggered from SEO and Previous post add-ons.

    Yoast: ___gaTracker()
    Standard : ga()

    Thread Starter chaff91

    (@chaff91)

    Hey.

    We just updated the plugin & tested running with GA by Yoast, but it appears to cause the same issue as before.

    Plugin Author Darren Cooney

    (@dcooney)

    Can you check with the google analytics function is in your head or footer?

    Thread Starter chaff91

    (@chaff91)

    Hey,

    It’s in the head section. Should I move it to the footer?

    Plugin Author Darren Cooney

    (@dcooney)

    No, head is where it should be.

    I mean what is the function…

    <script type="text/javascript">
    	(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','//www.google-analytics.com/analytics.js','__gaTracker');
    
    	__gaTracker('create', 'UA-46983621-3', 'auto');
    	__gaTracker('set', 'forceSSL', true);
    	__gaTracker('send','pageview');
    
    </script>

    Thread Starter chaff91

    (@chaff91)

    Hey, it’s pretty standard integration, code below (removed UA 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’,’//www.google-analytics.com/analytics.js’,’ga’);

    ga(‘create’, ‘UA-########-1’, ‘auto’);
    ga(‘require’, ‘displayfeatures’);
    ga(‘require’, ‘linkid’, ‘linkid.js’);
    ga(‘send’, ‘pageview’);</script>

    Plugin Author Darren Cooney

    (@dcooney)

    And you are saying this is not working?
    I’ve tested the standard and GA by Yoast and both are working on my live site.

    Plugin Author Darren Cooney

    (@dcooney)

    Can you confirm you have ‘Send pageviews to Google Analytics.’ checked on the ALM settings page?

    Thread Starter chaff91

    (@chaff91)

    Hey, just to confirm the ‘Send pageviews to Google Analytics.’ is checked, but I think I might not have been clear in what’s happening.

    So the pageviews are being sent to Google Analytics when Ajax loads the next one. But instead of sending the pageview URL as /blog-article-2 like you would normally see in Google Analytics, it’s sending the pageview URL as /https://www.domain.com/blog-article-2

    Plugin Author Darren Cooney

    (@dcooney)

    Oh weird.
    I’ll check out my install and see if this is contained to your environment.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Problem with Google Analytics Page URL Sending’ is closed to new replies.