• Resolved avgmatt

    (@avgmatt)


    I just started using this plugin and I do love it. It works perfect. I’ve great a trackable link going to my new Random link and I know the amount of traffic I get from that trackable link, but none of the traffic going to the Random link shows up on any other tracker. Google Analytics or any other website traffic counter shows any traffic that comes from my Random link. Do you know why that is or know how I can fix that?

    https://averagehunter.com/allposts/ <– Random Link

    Thanks
    Matt

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Robert Peake

    (@robertpeake)

    Hi Matt,

    The random endpoint URL isn’t going to display your Google Analytics tracking code, it’s just going to give back a redirect header to a random page. That subsequent random page should include your Google Analytics tracking code, however (assuming it’s configured correctly).

    Because the random URL endpoint isn’t giving back a full page, there’s no way to add the GA tracking code to it.

    However, you can add code to the page where the link to the random code is being displayed that “catches” the click on the random page link and sends tracking data back to Google. This is called “Event Tracking” and is detailed here:

    https://developers.google.com/analytics/devguides/collection/analyticsjs/events

    Good luck!

    Best,
    Robert

    Thread Starter avgmatt

    (@avgmatt)

    The part that doesn’t make sense is that every page is tracked normally. I have multiple trackers on my site that show every page hit, what pages we just hit and so on. But when a page is landed on via the random url, it doesn’t show up on any tracker or even any ad impression which really sucks with CPM stats.

    Plugin Author Robert Peake

    (@robertpeake)

    Hi Matt,

    The random url endpoint sends a few “cache-busting” headers to tell the browser not to cache the actual random URL page, and then uses wp_redirect() (a standard WordPress way to send redirect headers) to send a 302 Moved Temporarily header as well as a Location header that actually causes the browser to go to the new random page.

    All of this is really standard, and the result is that the browser does indeed go to the new page and execute all of the html and javascript on that page to render it (including any Google Analytics or other tags you might have).

    So, I don’t have any explanation for why the random url endpoint sending a browser to that page would be any different at all (in terms of tracking) than the same person typing in that URL directly, or clicking on a link to it directly. All of these scenarios should be identical in terms of what happens once you get to the page itself.

    Good luck tracking down what’s going on!

    Best,
    Robert

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Traffic Tracking’ is closed to new replies.