Katie Kinsley

How To Install Google Analytics on a WordPress Website

Install Google Analytics on WordPress

In this article I will share a tutorial of how you can easily install Google Analytics in your WordPress website.

If you don’t know what Google Analytics is or why you need it, please read this article. I dive into what Google Analytics is and why you need it on your website.



Install Google Analytics (a step-by-step guide)

1. Log into your Google Analytics account. Navigate to Admin > Property > Tracking Info. This will bring up a sub-menu.

Google Analytics Admin View

2. Click on Tracking Code. Copy the entire Global Site Tag code.

Google Analytics Tracking Code

3. Next, you’re going to login to your WordPress as an Admin user. Navigate to Appearance > Theme Editor*. On the left-side, under Theme Files, you’ll want to look for the header.php file.

WordPress Appearance Theme Editor

4. Open the header.php file. Paste the code from step #2 directly after the opening < head > tag. Then click Update File.

Intall Google Analytics WordPress

*Please note that I have made a child theme for my website. A child theme is essentially a copy of the original parent theme. As defined by the WordPress Codex, is a theme that “inherits the functionality and styling of another theme, called the parent theme.” If you add the Google Analytics code to your parent theme this way, the code could be erased in an update.

Alternative Install Method via Plugin

Another option to install Google Analytics on your WordPress website is to use a plugin. The Insert Headers and Footers gives you a simple interface with one place to insert scripts, rather than creating a child theme.

1. Add a new plugin. Install and Activate the plugin.

WordPress Insert Headers and Footers Plugin

2. Navigate to Settings > Insert Headers and Footers

Insert Headers and Footers

3. Paste the Google Analytics code into the Header section. Save and voila!

Insert Headers and Footers Google Analytics

Leave a Reply

Your email address will not be published. Required fields are marked *

Dallas Dreamhaus Katie Kinsley Selkie Puff Sleeve Dress

Hello I’m Katie!

Katie Kinsley is a Texas-based digital marketer and aspiring influencer. This is a lifestyle blog focused on Katie’s work-in-progress life. She’s focused on creating joy in the everyday, sharing adventures throughout Dallas/Ft. Worth (and the world), and empowering women to find their confidence — all in her unique unfiltered style.
KK Logo transparent

Recent Posts


Disclosure


Please note that I use affiliate links in my content as well as on my social media accounts. When you click and shop the links, we receive a commission. Sponsored posts are noted as such. Please see my full disclosure policy for more details.

You'll also love