Integrating Google Analytics with WordPress is an easy and quick task that you must carry out today. Even though your site can be awesome as it is, using data to enhance your content strategy is the only sure way to stay relevant to your target group. Keep reading to learn how to create a Google Analytics account and integrate it with your WordPress site.
Create Google Analytics Account
Follow these simple steps to create a Google Analytics account and get tracking ID and code:
- Go to this web address: https://www.google.com/analytics/
- Click on Log In or Create Account at the top right corner of the page. If you have a Google account, such as Gmail, Google+ or similar, you can use the same login details to log into Google Analytics. You can also create a new account, meaning new Google account, with a new email address.
- You get to a screen, describing the process in images. Click on Sign Up to the right on the screen.
- Fill out the form on the next page with your site’s details, as shown in the picture below. Account Name is a name you choose for data organization purposes. You can have multiple accounts within a single Analytics account. In each account, you can organize one or more tracking IDs. Each tracking ID is tied to one website. To exemplify what you use Accounts in Analytics for, imagine that you work as a marketing consultant for different companies. You can organize each company’s tracking IDs and data into a separate account. If running a single site, you still have to choose an Account Name, even though you likely won’t use it for anything. Website Name is the name of the website you currently want to integrate with Google Analytics. Website URL is the exact URL of the website, you’re connecting Analytics to.
- Consider carefully the Data Sharing Options at the end of the page. Even though Google urges you to enable them all, keep in mind that sharing your data only helps Google deliver their (paid) services, not you. You’ll likely never use technical support, as issues are quite rate on account level and you’ll never use account specialists, as long as you only use free Google Analytics products.
- Click on Get Tracking ID at the bottom of the page.
- Read and accept the Terms of service in the popup window.
- On the next page, you can see the tracking ID and code. They can only be used on the website, you specified during registration. If you need to track web traffic on another website or a subdomain/subdirectory of your current one, you have to register a new property (site) and use the tracking ID and code, you get in the process.
- You will be using the tracking code and ID later on but you don’t need to save them in any way. You can always find them in your Google Analytics Account under Admin->Your site’s account->Your property (site)->Tracking Info->Tracking Code.
Integrating Google Analytics With WordPress Without A Plugin
There’re two ways to integrate Google Analytics (GA) and WordPress without a plugin: by editing the <head> part of each page on your website or by entering the GA tracking code or ID in a specially dedicated filed in the settings of your theme.
If you choose the first option, you have to copy the code, shown in the picture above, and paste it in the <head> on every page, you want to track, right before the closing tag. While this task isn’t difficult, it can be very time consuming, especially if your site features an active blog. Having to manually tag every new page makes it also complicated to work with multiple publishing authors, which often is the case of large blogs and websites.
Therefore, most WordPress themes have an option to integrate GA by simply entering the tracking code or ID in a dedicated field in Theme Settings. It could look something like this:All you have to do is copy-paste the whole GA tracking code into the field and press on Save. Now, WordPress should be integrated with Google Analytics.
Keep in mind that up to 24 hours can go, before you’re able to review data in Google Analytics. If you, therefore, are in doubt, whether the integration was successful, you can check this by sending test traffic. You can do this in Admin->Account name->Property name->Tracking info->Tracking Code.At the top of the page, you can check the current reporting status. If no traffic has been received in the past 48 hours, you can send test traffic to test the integration.
Even though this is mostly relevant in the beginning, sometimes unexpected traffic interruptions can also occur later on, requiring you to perform the check and possibly re-connect your site to GA.
Integrating Google Analytics With WordPress With A Plugin
If you for some reason can’t integrate GA with WordPress, using the theme’s options or if your theme doesn’t at all provide such an option, you can still easily do it. All you need, is a plugin and chances are that you have already installed it or were planning to install it anyway.
All major SEO plugins, as Yoast SEO and All in One SEO, provide the option to connect to all important services, such as Google Search Console, Bing Webmasters, and Google Analytics. This makes it unnecessary to install a plugin, handling specifically the GA integration.
If you use a SEO plugin, as All in One SEO (in the screenshot), all you have to do is enter your tracking ID. It works the same way as the tracking code and enables you to track traffic and visitor behavior on your pages. That’s it. Google Analytics is integrated with WordPress. If in doubt, whether the integration was successful, use the method described above, to check.
When working with code generally, you have a choice: do it all yourself and be sure that you did everything correctly; or automate code editing by using plugins and hope that, whoever made the plugin, did a good job.
The biggest plus of using the theme’s own GA integration or a plugin is that you don’t need to manually add the tracking code to all of your existing pages and to all new ones, once they are about to be published. The downside is that you don’t have a guarantee that the theme or plugin you choose will implement GA correctly and place the tracking code where it should be placed.
You can, of course check this by right-clicking in the browser window, while viewing your site, and choosing Show Source Code. Then, find the closing HEAD tag. Here’s how it looks:In the screenshot, you can see the last line of GA tracking code, finishing with the closing SCRIPT tag, just before the closing HEAD tag. This is an example of correctly implemented GA integration.
If your code doesn’t look like that and your data seems distorted, consider using alternative methods for integrating Google Analytics with WordPress.