[Support request] Element for code

Home Forums Support [Support request] Element for code

Home Forums Support Element for code

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2006032
    Simone

    Hi
    How can I add my Google Analytics code to the element?
    Thank you!

    #2006102
    David
    Staff
    Customer Support

    Hi there,

    1. Create a new Hook Element.
    2. Add your <script> to the Hook Content.
    3. Select the Hook: wp_head
    4. Set the Display Rule Location to Entire Site.

    If you’re using Google Tag Manager it provides a second code for adding after the Body Open tag.
    If you’re using GTM. Then repeat the above for the second code. And change the Hook to wp_body_open

    #2009067
    Simone

    Thank you, David!

    #2009177
    David
    Staff
    Customer Support

    YOu’re welcome

    #2011988
    Simone

    Hi David, I inserted the code in the hook and location to the entire site. How come it shows in the header?https://www.screencast.com/t/CG1xvAvLlr

    #2012275
    David
    Staff
    Customer Support

    Make sure:

    1. The hook selected is the wp_head hook.
    2. Make sure your code has the relevant tags – see here for an example of adding GTM Codes:

    https://docs.generatepress.com/article/implement-google-tag-manager/

    #2012987
    Simone

    I don’t find this type of code in Google Analytics. Is there another way I can insert the code in GP theme?

    #2013051
    David
    Staff
    Customer Support

    What code are you trying to add ?

    #2014315
    Simone

    Code from Google Analitycs G-Z227365PZ3

    #2014468
    David
    Staff
    Customer Support

    You need to get the tracking script from your google analytics account.
    See here:

    https://support.google.com/analytics/answer/1008080?hl=en#zippy=%2Cin-this-article

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