[Support request] Adding Google Analytics

Home Forums Support Adding Google Analytics

  • This topic has 1 reply, 2 voices, and was last updated 1 year ago by David.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1005339
    Conor

    I was looking in the forum and I saw a lot of stuff about child theme and hooks and I didn’t really know what they meant..

    I know I have to copy the google analytics code to the header of my website, but I have also read that it can disapear whenever I update my site.. is there anyway to add google analytics and have it on the site without needing to update it?

    cheers,
    C

    #1005536
    David
    Staff
    Customer Support

    Hi there,

    you can use the Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

    With the Elements module activated, Appearance > Elements > New Hook.
    Add your GA Script to the Content.
    Select the WP_Head hook from the Hooks List.
    On Display Rules tab set to Entire site.

    This won’t be affected by updates to the theme.

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