WordPress Quick Tip: Adding Google Analytics to your site

You are here:
Estimated reading time: 2 min

In this article I will show you how to easily add your Google Analytics code to your WordPress website.

Installing the Plugin

First you need to go to Plugins, Add New to search for the plugin. Type “google analytics” on the search box.

Add new plugin

We’re going to use “GA Google Analytics” by Jeff Starr. Click the “Install Now” button to proceed with the installation.

Search for Google Analytics
Search for Google Analytics

As usual remember to activate the plugin in order to use it.

Activate the plugin

Once the plugin is activated the installation will take you to the plugins page where you can see it has been added. To configure the plugin click on Settings.

Click on settings to configure the plugin
Click on settings to configure the plugin

On the settings page for the plugin you can either click on “How to Use” to read a bit more about how the plugin works or go directly into “Plugin Settings”.

Click on Plugin Settings to add your information
Click on Plugin Settings to add your information

Getting your GA tracking ID

In order to connect your site to the analytics software you need to add a Google Analytics tracking ID, so let’s go to your Google Analytics account to do that (https://analytics.google.com/). In there you should have your website as a property. If not, then create it then choose it. Down in the left bottom side there is a link to “Admin” click on that to search for your ID.

Choose your property and click on Admin
Choose your property and click on Admin

On the property, click on Data Streams.

Click on Data Streams
Click on Data Streams

If you don’t have a stream set up click on the blue “Add stream” button and choose web. Once setup you can click on top of the stream name to access more information.

Choose a stream or add a new one
Choose a stream or add a new one

From this screen you can copy the Measurement ID immediately or use the code on tagging instructions (if you are adding the code without a plugin). Your ID will be different from the one in this example.

Get your ID
Get your ID

With this ID on hand you will add it to the plugin on your site. Make sure you save your changes.

Add the ID and then save your changes
Add the ID and then save your changes

Verifying the code

In order to check if your code was successfully added go to your homepage and right click on the page. Choose the “View Page Source” option that comes up in the menu.

View Page source
View Page source

This will bring up a screen with lots of code so you can do a quick search for “GA Google Analytics” and it will take you to the code where you can double check your ID is the correct one (yours will be different from the one in this example).

Find the GA Google Analytics text
Find the GA Google Analytics text

And you are all set up to start gathering visitor data.

Some themes have a place in their settings where you can add the Analytics code. Divi is one example of such themes, where you go to the theme options and under “Integration” you can write the code you want to add to the head section of your website. That’s where the Google Analytics code would go.

Adding analytics code to Divi Theme
Adding analytics code to Divi Theme

Resources

Google Analytics – https://analytics.google.com/

GA Google Analytics – https://wordpress.org/plugins/ga-google-analytics/

Divi Theme by Elegant Themes – https://www.elegantthemes.com/join/

Thank you for reading.

Was this article helpful?
Dislike 0
Views: 4