The Ultimate How-To for Setting Up a Google Analytics Plugin
Google Analytics is one of the most widely used data-tracking tools online. According to Google developers, “millions” of sites and apps use Google Analytics.
Google made some critical updates to the data insights tool in the past few years, and it officially launched Google Analytics 4 in 2020.
While its features are phenomenal, using the tool can be tedious. That’s why many WordPress users choose to install a Google Analytics plugin. Plugins streamline and automate the data-gathering elements of GA.
This makes it easier to use, and it improves the accuracy of the resulting insights.
But how do you set up a Google Analytics plugin? Let’s find out in this ultimate guide to Google Analytics plugin setup.
How to Setup Your Google Analytics Plugin: Overview
There are numerous WordPress plugins that help you configure Google Analytics for your website.
The process of setting up Google Analytics on your website will vary a bit, depending on which plugin you choose. But, these are five general steps to follow in the majority of instances.
These five steps let you install, set up, and effectively use the plugin.
Of course, managing and updating all of your plugins can get overwhelming. That’s why many users choose to invest in WordPress support services.
These services make complex guides unnecessary. They do the management for you, so you can get back to the parts of running your site you actually enjoy.
1. Create a Google Analytics Account
To create a Google Analytics account, head over to the official Google Analytics website. Then, click “Get Started Today.”
You will be prompted to sign in with your Google or Gmail account. After you do that, it should take you to a screen with a blue button that says, “Start measuring.” Click that button.
The next screen displays data sharing settings. The default settings work for most people. Still, it’s worthwhile to explore the benefits and drawbacks of different data sharing settings via Google’s support article on the subject.
The next screen will prompt you to create a Google Analytics property. Create a property for the WordPress site you want to use the plugin with. Associate your property with a Time Zone and a currency.
After that, click the “Next” button.
The next screen will prompt you to give Google Analytics details about your online business—its information category, your business size, and so forth. Then, you can tell Google Analytics your business goals for measurement.
Finally, click “Create.” Make sure to accept the terms and conditions.
Create Data Stream
Once you’ve created your account, look for the Web Stream options on Google Analytics. For your property, set up a “web” data stream. Enter your WordPress site’s URL, and name the data stream.
Select the appropriate measurement options. Then, click “Create Stream.” This should now show you the stream’s name, plus its “Measurement ID.”
2. Install and Activate Your Plugin
Once you know which plugin you want, install and activate it. There are two methods to install, activate, or update plugins.
You can do this from your WordPress dashboard. Or, you can start installation through a third-party directory.
Via WordPress Dashboard
On your WordPress dashboard, open the “Plugins” menu. Then, select “Add new.”
Search for the Google Analytics plugin you want to use with the search bar in the upper right-hand corner of your dashboard. Scroll through the results until you find the one you want.
After you find it, click the “Install Now” button on that plugin’s result.
Once the plugin finishes installing, you can activate it. Simply click the button labeled “Activate” in the upper-right-hand corner.
Via Third-Party Directory
Third-party directories of WordPress plugins should let you download a .zip file of the plugin. Download the .zip file and save it where you can easily find it.
Then, go to your WordPress dashboard. Go to “Plugins.’ Then, select “Add new.”
From there, look for the button labeled “Upload Plugin.” It should be in the topmost toolbar, on the upper-left-hand side of the dashboard. This should take you to a screen with a button that says, “Choose File.” Click it.
Select your plugin’s .zip file, then click the button labeled “Install Now.” After the installation finishes, click “Activate.”
3. Launch Setup Wizard From WordPress Dashboard
Once you’ve installed and activated your plugin, it’s time to set it up.
Go to your WordPress dashboard. You should now see an option for your Google Analytics plugin. Click it and choose “Launch Setup Wizard.”
Click through all setup screens. Make sure to grant the plugin all necessary permissions.
Launch Pages, Permissions
Once you launch the plugin’s setup wizard, it may ask you to choose a category for your business. If so, choose the one that fits best. Then, click “Save and Continue.”
Then, connect Google Analytics to your website. The setup wizard should prompt you to do this with a button. Make sure to connect your website to your Google account with Analytics.
Your Google Analytics plugin will likely then prompt you to choose settings. The default settings typically work. But, you’ll have to add the path for your affiliate links if you use an affiliate links plugin.
After that, you’ll need to enable tracking features. Enable most basic tracking features to start with.
At that point, you should be able to complete the setup!
Note: Tracking Code
Some Google Analytics plugins will ask you for tracking code information.
To find the tracking code information for your WordPress site, go to your Google Analytics dashboard. Click the cog icon in the bottom left corner (this is the Google Analytics admin tab).
In the tab, select the WordPress account and domain you’re looking to track and analyze. You might need to open a drop-down menu under the “Property” section. Then, click “Tracking Info.”
This should give you the Google Analytics data relevant to that WordPress site.
If your plugin needs the site’s Tracking Code, that should be at the top of the list of options.
After inputting the tracking code, scroll down in the Google Analytics admin tab, in the “Data Stream” section. Under “Tagging Instructions,” you should see the “Global Site Tag.”
The Global Site Tag is a block of HTML code that enables analytics. Add the Global Site Tag to the “head” section of your website’s HTML.
Add Global Site Tag to WordPress Site Header
There are two ways to add the Global Site Tag to your site’s code. You can use an “Insert Headers and Footers” plugin. Or, you can do it manually.
To use a plugin, follow the directions explored earlier on how to install and activate a plugin.
To add the Global Site Tag manually, follow these steps.
First, copy the block of HTML text that comprises your WordPress site’s Global Site Tag.
Then, log into your WordPress administrator. Click “Appearance.” Then, click “Editor” to open the site editor.
In the Editor, find your WordPress theme’s “header.php” file in the list on the right-hand side of the screen. Open “header.php” in the Editor.
Paste your WordPress site’s Global Site Tage into the “header.php” HTML code, above the “</head>” tag in the file.
Finally, save your code changes by clicking “Update File.”
4. Establish Measurement Protocol (eCommerce Activity Tracking)
According to Google, the measurement protocol is a set of rules for collecting hits your site receives from different connected devices, and sending them to Analytics. This is critical for tracking payment data.
Google Analytics should automatically receive data about hits from mobile apps and your website. But, you must manually build data collection hits to track:
- Actions in online store (add to cart, etc.)
- eCommerce purchases
- Hits from point-of-sale systems
- Hits from kiosks
Most Google Analytics plugins will require you to create a Measure Protocol API Secret for each site you want to track these types of interactions on.
Create a Measure Protocol API Secret
To create one, log in to your Google Analytics account. Go to the “Admin” settings page. Click “Data Streams.”
In the Data Streams page, select the website you previously connected with your Google Analytics plugin. This should open a new screen.
On the new screen, scroll down to “Advanced Settings.” Then, choose “Measure API Protocol Secrets.” This may be under the heading “Additional Settings” in the menu.
The “Measure API Protocol Secrets” page should open. Click the white button labeled “Create.” Give your API secret a nickname.
After naming the secret, click the second “Create” button. This button is blue.
Once created, you can copy the secret value. This is a code under the field labeled “Secret value.”
After copying the settings, open your Google Analytics plugin’s settings menu. To do this, go through the WordPress admin panel and click “Insights.” Then, choose “Settings,” and open “Google Authentication.”
In the field labeled Measurement Protocol API Secret, paste the code you copied earlier.
Need WordPress Maintenance Services?
WordPress maintenance services are a great way to keep your website up-to-date and running smoothly. Plugins–including the Google Analytics plugin—can give your site critical data and features.
But, when poorly managed, they can also cause a site to lag. Incorrectly installed code can even make a site crash.
Get the resources you want from WordPress, without the hassle. Learn how site management services can empower your business when you book a call today.
Join Our Newsletter
Stay up to date on the latest WordPress tips and news