Site logo

[Support request] Installing New Tracking ID For Google Analytics 4

Home Forums Support [Support request] Installing New Tracking ID For Google Analytics 4

Home Forums Support Installing New Tracking ID For Google Analytics 4

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2499786
    Luke

    Hello

    I want to install new tracking ID on my blog for Google Analytics (you know GA4).
    I installed my old ID using All In One SEO Pack plugin, but I’m not sure how to do it now. Of course I don’t want to switch to using GA4 right now, I still want to be using Universal Analytics, but I know that both of them can work simultaneously and they don’t interfere with each other.

    When I’m using Generate Press is there a better way to install this code than using All In One SEO plugin? Can you recommend me something?

    #2499794
    Fernando
    Customer Support

    Hi Luke,

    You can use a Hook for this.

    Basically, you just need to add your GA4 code through a Hook Element. Conceptually, the process would be the same as it is for GTM: https://docs.generatepress.com/article/implement-google-tag-manager/

    This is one approach to do it through GeneratePress without using a third-party plugin.

    #2499815
    Luke

    OK, when I clicked the link the instructions say to do this:

    Go to Appearance > Elements and click “Add New”.
    From the Element dropdown list, choose “Hook”.
    Copy and paste the your own code into the content area.
    Under Settings tab, select wp_head in the Hook dropdown list.
    Under Display Rules tab, select Entire Site in the Location dropdown list.
    Click the Publish button then we are half way done.

    Then below I see similar instructions:
    Go to Appearance > Elements and click “Add New”. From the Element dropdown list, choose “Hook”.
    Copy and paste the your own code into the content area.

    — Does it mean I’m supposed to do the same thing twice?

    What about the 2 blocks of codes? Do I need to copy and paste them somewhere?

    I’ve just noticed that the GA code appeared in the left upper corner of my site on the Homepage. I think I’m doing something wrong!

    #2499963
    David
    Staff
    Customer Support

    Hi there,

    in your GA account – copy the Global site tag (gtag.js) script.
    in WordPress -> Appearance > Elements -> Add a New Element -> Hook.
    Paste in your script into the text area.
    Set the Hook element to the wp_head
    Set the Display Rules.

    Thats all that is required for Google Analytics.
    The 2 part method in that doc is only required if you’re using Google Tag Manager.
    You can read more here on GTM and GA:
    https://www.searchenginejournal.com/google-tag-manager-ga4-guide/396169/

    #2499997
    Luke

    OK, I’m in the Display Rules tab now.

    Should I choose Entire Site in the Location?

    I suppose I don’t have to do anything with Exclude and Users?

    #2500039
    David
    Staff
    Customer Support

    Set it to the Entire Site.
    And leave the other options alone 🙂

    #2505227
    Scott

    You should sticky this!

    #2505632
    David
    Staff
    Customer Support

    I think we need to update our docs lol
    I must say Google could make this kind of change a little clearer … i had to treble check it 🙂

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