• I am using a child theme for my website. I want to add google analytics to the website – google gave me these instructions

    Global Site Tag (gtag.js)
    This is the Global Site Tag (gtag.js) tracking code for this property. Copy and paste this code as the first item into the <HEAD> of every web page that you want to track. If you already have a Global Site Tag on your page, simply add the config line from the snippet below to your existing Global Site Tag.

    I obviously want to add this code to only one place not manually add to every page on my website. I am using child theme on the site, so can you recommend which file in my child theme I should add this code to to implement the google global site tag tracking code?

    • This topic was modified 5 years, 2 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • We can’t really tell you what file, but if the child theme has a file named header.php, if would be in there. If it doesn’t, look for that file in the parent theme and copy it to the child and put it in there.

    Thread Starter dot12b

    (@dot12b)

    Great thank you, I’ll try that.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Where to add Global Site Tag tracking code in child theme’ is closed to new replies.