[Support request] Google Analytics Code Not Working After Switching to GP

Home Forums Support [Support request] Google Analytics Code Not Working After Switching to GP

Home Forums Support Google Analytics Code Not Working After Switching to GP

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2291542
    Alyson

    Hi, I’ve switched 2 existing sites to GP day before yesterday, I’ve pasted in the tracking code using hooks as instructed (I’ve changed themes dozens of times before with no issues) and GA isn’t working. The strange thing is it’s picking up me as a visitor in RealTime, but nobody else. Both sites had steady traffic previously. Ezoic (both are on Ezoic) is also not picking up traffic. I was about to switch my big site to GP too, but can’t if this is going to happen.
    I’ve cleared Ezoic caching, there’s no other caching on them. They’re still appearing in the SERPS.
    I’m thinking this is down to Google changes with GA4 coming in, so I’ve also set one up as a GA4 property. And same, it’s just tracking me.
    Any ideas?
    Thanks.

    #2291835
    David
    Staff
    Customer Support

    Hi there,

    in the <head> of both sites i see two GTAG scripts, both with different IDs.
    If your Right Click > Inspect the site in Chrome and in the Developers Tools > Elements tab, expand the head element.
    You can use CTR + F to open the finder and search for gtag to jump through them.

    See here:

    2022-07-24_10-37-47

    Not i deleted some elements from that list so as it would all fit on one screen.
    Note the green highlight – this is roughly where the wp_head hook exists that GP Elements can insert into, the red box below it is highlighting the second GTA script, and going by its position i assume its the one in the GP Element.

    The one at the very top, isn’t coming from GP Elements, as to get there requires some kind of proxy injection.
    Do you recognise those higher up gtags ?

    #2295489
    Lindsay

    I’m having the same problem with my site. I can’t tell if the problem started with GP or with Autoptimize. It appears my Google Analytics plummeted back in 2021 when I switched my site to GP and started using Autoptimize. Google Search Console seems to be tracking visits and such, but Analytics only tracks my personal admin page visits.

    I stepped away from my site for several months and am just realizing this now.

    Can anyone help me figure out this problem? Been wracking my brain to figure this out for weeks now.

    Thank you!

    #2295538
    Ying
    Staff
    Customer Support

    Hi Lindsay,

    Can you open a new topic and link us to your site?

    You can use the private info field for site info.

    How did you add the Google Analytics code in your previous theme and GP?

    #2296781
    Alyson

    No I don’t. I didn’t think I was using tag manager. This site was previously on Studiopress Genesis and it was very easy to just paste these codes between the <head> tags. Analytics has started tracking now on both the sites I sent to you. Are you still seeing strange code?

    #2296881
    Fernando
    Customer Support

    Hi Alyson,

    I’m seeing it from my end as well: https://share.getcloudapp.com/d5uO5wAj

    Do you recall adding it some other way like through a plugin?

    Maybe you can you try #1 here if so?: https://docs.generatepress.com/article/debugging-tips/

    It would be good to take a backup of your site before doing so.

    #2302652
    Alyson

    No, I’ve never had to use a plugin for GA code on any of my 8 sites. As the garden site above is my youngest, I’d remember. And it was on a theme I’ve used for years with no issues. Are you seeing the same thing on the other site I switched to GP?

    #2303000
    David
    Staff
    Customer Support

    Would you be able to provide us with a temporary admin login so we can take a look at the backend ?

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.