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.
We’re going to use “GA Google Analytics” by Jeff Starr. Click the “Install Now” button to proceed with the installation.
As usual remember to activate the plugin in order to use it.
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.
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”.
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.
On the property, 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.
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.
With this ID on hand you will add it to the plugin on your site. Make sure you 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.
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).
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.
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.