QuestionsCategory: General QuestionsGoogle Analytics
Keith Keenan asked 2 months ago

How do I install my gtag.js code into my header??

4 Answers
Jeremiah answered 2 months ago

There are a few ways to do this. Often your SEO plugin will handle this for you. You just need to add your Analytics ID to your SEO plugin. SEOPress does it, I think Yoast no longer does. Also there are dedicated Analytics plugins, like Monster Insights.

You can use your functions.php to hook into the header and add the code, or more easily use a plugin to do the technical stuff for you. Insert Headers and Footers is a good one: https://wordpress.org/plugins/insert-headers-and-footers/

Keith Keenan answered 2 months ago

Thanks once again for the great info!
 

Naman Modi answered 2 months ago

To install the global tracking snippet, copy the following code and paste it immediately after the tag on every page of your site. Replace GA_TRACKING_ID with the tracking ID of the Google Analytics property to which you want to send data. You need only one global snippet per page.

Naman Modi answered 2 months ago

To install the global tracking snippet, copy the following code and paste it immediately after the tag on every page of your site. Replace GA_TRACKING_ID with the tracking ID of the Google Analytics property to which you want to send data. You need only one global snippet per page.

Your Answer
6 + 1 =

Accepted file types: png, jpg, pdf

Add another file