Site logo

[Resolved] Where to put Google Analytics code?

Home Forums Support [Resolved] Where to put Google Analytics code?

Home Forums Support Where to put Google Analytics code?

Viewing 15 posts - 1 through 15 (of 42 total)
  • Author
    Posts
  • #1803679
    Heath

    I have the GP Premium and currently put the code in a hook in the wp_head with the entire site checked. I’m not sure this is where I need to put it as numbers over the last several days don’t seem accurate. Is that correct?

    #1803731
    Leo
    Staff
    Customer Support
    #1803843
    Heath

    Hmm. My analytics is not working.

    #1803950
    Elvin
    Staff
    Customer Support

    Hi Heath,

    Can you share the script you’re trying to add? (use the private information text field)

    I’ve checked the site and I don’t see the usual google analytics script on the <head> of your site.

    Note: Google takes time to reflect the data. Even when the script is properly loaded, it takes time to display things right. 🙂

    #1803960
    Heath

    This is I guess Google Analytics 4 code. This is the exact code that analytics says to add in the header.

    #1804001
    Elvin
    Staff
    Customer Support

    Thanks.

    I’ve rechecked again and found it as shown here – https://share.getcloudapp.com/v1uYvg5Z

    I’m not sure if this is the right script, but if it is, then we should give Google a few hours to get things going as this isn’t something instant. It will take Google Analytics sometime before showing your stats.

    Tip: If you find this lacking, consider using a plugin. Check this – https://www.wpbeginner.com/beginners-guide/how-to-install-google-analytics-in-wordpress/ (MonsterInsight)

    #1804008
    Heath

    Yeah I seems to be at least partially working at the moment. Thanks for checking.

    #1804037
    Elvin
    Staff
    Customer Support

    No problem. Glad to be of any help. 😀

    #1806690
    Heath

    Just to let you know, the numbers seemed off again. Out of curiosity, I switched back to my old theme and the analytics are flowing like a charm so I’m not sure what it is about GP that I’m not able to get my analytics in there right.

    #1807028
    David
    Staff
    Customer Support

    Hi there,

    looks like you’re running Google Tag Manager – which requires two codes, the first code provided gets hooked into the wp_head – the second code they provide should be hooked into the wp_body_open

    Also ensure and Plugin and server side caches are cleared after making these changes, this will ensure the updated page gets served up for the analytics scripts to fire.

    #1807091
    Heath

    Yeah. I was doing that. Unless I had something off but I triple checked.

    #1807172
    David
    Staff
    Customer Support

    Looks like you have another theme installed on the site.
    I ran a gachecker test on the site and the vast majority of the URLs failed to display a valid GA or GTM Tag.
    Then i took a closer look at some of the failed URLs eg.

    https://theprospecttimes.com/tag/joey-gallo/

    And this has 2 x instances of gtag/js installed into <head> which is why that one failed.

    So i can only assume you have another plugin or function that is adding GA scripts … considering this is not even on the GP theme.

    #1807242
    Heath

    I just ran that as well and have no clue what would cause that. I dont have any plugins adding any GA code.

    #1807255
    David
    Staff
    Customer Support

    Any custom functions in say the Code Snippets plugin ?

    #1807260
    Heath

    I would say yes but that plug-in isn’t active. I’m not even sure I have that even as an inactive plug-in. This is bothering me because I really want to have GP as my theme. Now I’m not even sure if the numbers I am seeing are accurate.

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