Paste the Analytics Code into Your Website

OK, you’ve generated the code and copied it. Now… how to get it into your website. It has to go before the </head> tag on every page that you want to track. You could do it page by page by editing the html directly but that’s clearly impractical. Here are two easy methods:

If You Have the Thrive Suite

If you have the Thrive Suite, the Thrive dashboard makes it very simple.

Go to the dashboard and scroll to Analytics and Scripts.

Click the Manage Scripts button.

This will show any existing scripts and you can choose to add a new one.

Click the Add New button.

You can paste the Google Analytics script into the next screen.

Paste the copied script into the Script panel and click in the Script Label panel to bring up the automatic label Google Analytics.

Leave the Placement as Before </head> and tick both Inserted In check boxes.

Click the Continue button.

This will then show that the Analytics script has been added.

Click the Back to Dashboard button.

If You Don’t Have the Thrive Suite

You can also insert the Google Analytics script with the free Ad Inserter plugin.

Install it as you would any plugin.

Search for Ad Inserter, then click Install Now, followed by Activate.

Then go to Plugins >> Ad Inserter >> Settings

Click Settings to bring up the Ad Inserter Settings page.

Click the gear icon to get into General Settings.

This will allow us to insert code into the header of all pages, i.e., between the <head> and </head> tags, which is where the Google Analytics code needs to go.

Click on the Header tab, then enable header code by clicking on the middle of the three small buttons (the one next to the php button) and finally paste the copied Google Analytics code into the panel.

Click the Save Settings button.



Join the Discussion
Write something…
Recent messages
Lizken Premium
Hello Phil,

A little question to you, the older version of GA has stopped working for me somehow,so I can just delete it now, right?
That will not put GA4 in any danger or my website tracking?
I still need to figure out the details though, of the new version, I don't really like it all this far. It is hard to see the traffic coming exactly from each social media channel, etc. I dislike the change haha! So I'm not sure, I just might hold on to it a bit longer and try to put my tracking code for the original one back on my website, or is that too much and impossible?
A little bit confused here, thanks!
Reply
phil1944 Premium
The UA code isn't being discontinued until next year so if you want to retain it/put it back, that shouldn't be an issue. I don't know why it should have stopped working. I have GA4 on all my sites now.
Reply
Lizken Premium
thanks,I will check out your part 3 first, before I decide what to do ;-)
Do you find it easy to interpret the stats with GA4?
Reply
phil1944 Premium
I'm not big on digging deep into GA stats, Lizzy. Monster Insights gives me all I need without having to leave the website.
Reply
Sahida51 Premium
Hi Phil!
What is thrive suite? Few month a go I have invested Google Analytics code on Ad Inserter Plugin but it never work the plugin was giving problem to my site so site support team has asked me to delete it. Can I insert in all-in-one webmaster tool or not.
Thank you
Reply
phil1944 Premium
Thrive Suite is a collection of themes and plugins that are very powerful but probably not for the beginner. I'm sorry Ad Inserter didn't work for you. By all-in-one webmaster tool, do you mean AIOSEO? I don't know how to use that to insert code. You could try putting the question to Live Chat.
Reply
phil1944 Premium
Just letting you know that Part 3 is now available at
Reply
phil1944 Premium
I've now created training for GSC as well. It's at
Reply
RVsRock Premium
Phil,

You saved the day for me and so many others, I'm sure.

I had already converted all my properties to the GA4 property tags, but was not sure how to get the new coding to be inserted into the Header Section.

I did this a few years back, but could not remember all the details. And as you pointed out, Google has made a lot of changes on their analytics instructions.

Without your concise training, I would have never been able to get this done in a timely manner.

Thanks Phil!
Eric aka RVsRock
Reply
phil1944 Premium
Just letting you know that Part 3 is now available at
Reply
RVsRock Premium
Thanks so much!
Reply
phil1944 Premium
You're welcome, Eric.
Reply
phil1944 Premium
I've now created training for GSC as well. It's at
Reply
RVsRock Premium
Phil,

All I can say is this. You and Jeffrey Brown have more energy than the Sun shining down on our planet. Both of you are talented beyond words.

Thanks a million!
RVsRock
Reply
phil1944 Premium
Gosh, Eric. I'm overwhelmed but yes, I'm a great admirer of Jeff.
Reply
west2000 Premium
You've done a super job on this training, Phil! It's easy to follow for any level and all the images are very helpful. I wish I'd known all this earlier.

Out of curiosity, In order to convert over to the new A4, would you have to go through this from scratch or is there a simpler way?

Great job!
Susan
Reply
phil1944 Premium
Thanks, Susan. I'm yet to convert my own sites, but I think you would remove the old code from your website, then get the new code and paste in in place.
Reply
west2000 Premium
That seems logical. Appreciate this. Thanks, Phil!
Reply
phil1944 Premium
Just letting you know that Part 2 has now been published at
Reply
west2000 Premium
Fantastic, Phil! I look forward to reading this shortly. Thanks for letting me know.
Reply
phil1944 Premium
You're welcome, Susan. I hope you find it useful.
Reply
west2000 Premium
Definitely, Phil...I'm bookmarking it for quick reference :-)
Reply
phil1944 Premium
Good to hear, Susan.
Reply
phil1944 Premium
Just letting you know that Part 3 is now available at
Reply
west2000 Premium
Appreciate that, Phil...thank you :-)
Reply
phil1944 Premium
You're welcome, Susan.
Reply
phil1944 Premium
I've now created training for GSC as well. It's at
Reply
west2000 Premium
Thanks, Phil...I'll be sure to check it out shortly.
Reply
phil1944 Premium
I hope you find it useful.
Reply
Lizken Premium
I haven't read the whole article yet, but google analytics is planning also on completely transferring to GA4 in 2023 as well. I am sure that there will be more training on this soon. I don't like that change, but I will have to change anyway haha.
Thanks though for explaining this to the people who are confused;-)
Reply
phil1944 Premium
Yes, I slanted the training towards GA4 as that's where Google is headed exclusively. It's certainly made it more confusing to implement, which is why I went for a step by step approach.
Reply
phil1944 Premium
Just letting you know that Part 2 has now been published at
Reply
Lizken Premium
thanks Phil!
Reply
phil1944 Premium
You're welcome, Lizzie.
Reply
phil1944 Premium
Just letting you know that Part 3 is now available at
Reply
phil1944 Premium
I've now created training for GSC as well. It's at
Reply
Lizken Premium
thanks
Reply
phil1944 Premium
You're welcome, Lizzy
Reply
Top