SEO

How to add Google Analytics

 

To add Google Analytics to your WordPress site, you can either do it within the WordPress administration or manually. We’ll show you how to do both in this tutorial.

Here’s how to do the first method:

1. Log in to Google Analytics and then go to Admin.

Screenshot of going to Admin

2. You must have already set up a domain name in analytics. Once you’ve done that, select Tracking Info, and then click Tracking Code.

Screenshot of clicking Tracking Code.

3. You’ll need either the Tracking ID or the Website tracking code. Log into your WordPress Admin to add it there.

Screenshot og Tracking ID and Website tracking code

4. After that, we’ll install a plugin. Go to Plugins and then select Add New.

Screenshot of selecting Add New

5. Search for Google Analytics. Click Install Now, then Activate Plugin.

Screenshot of clicking Activate Plugin

6. After installing the plugin, go to Settings and then select Google Analytics.

Screenshot of selecting Google Analytics

7. It will prompt you to enter a Web Property ID; go back to the Google Analytics page and copy the Tracking ID.

Screenshot of copying the Tracking ID

8. Paste the Tracking ID into the Web Property ID and save the changes.

Screenshot of pasting the Tracking ID into the Web Property ID

9. Analytics is now tracking your website.

10. If you use a premium theme, you might not need a plugin. This setting is probably already in place for you. To add the Google Analytics code, check the Theme settings to see if they have a Property ID anywhere. Copy the Tracking code for the website if it is not an Analytics code or a Property ID.

 

The second method is as follows:

1. We can manually add the analytics code via FTP. Login to FileZilla to get started.

2. Next, go to your Theme folder.

Screenshot fo Theme folder

4. Look for header.php and right-click on it. Select View/Edit, then click OK.

Screenshot of selecting View/Edit

5. You should insert the code just before the head closes. Go back to Analytics and copy the Website tracking code.

Screenshot of copying the Website tracking code

6. Paste the code just before the close tag, then Save the changes.

Screenshot of pasting the code just before the close tag

7. Analytics may take up to 24 hours to begin tracking. If it isn’t tracking, just check that the settings are correct.

Wordpress Basics

View more

Wordpress Editing

View more

Wordpress Plugins

View more

WooCommerce

View more

Troubleshooting

View more

Guides

View more

Hosting & Domains

View more

SEO

View more

Advanced

View more