How to Add Google Analytics to Your WordPress Website

Here are two different ways to add Google Analytics to your WordPress website. First, we need to create an account and an associated property. Then we’ll assign a property code to our website. Here’s how to do all of that:

  1. Login to Google Analytics using your Gmail login credentials. Bookmark this page for easy access.
  2. Click on Admin
  3. Click on Account > Create New Account: This will be the name of your account associated with a single website, or group of websites. If you manage websites for a variety of different clients, each unknown to each other, you should create separate accounts for each client. When you do this, you can grant account access privileges to each client to view analytics data for only their respective website(s) associated with their specific account. In your Admin panel under All Web Site Data, click on User Management to grant and modify account access privileges.
  4. Click on Property > Create New Property: Properties are your website URL’s. You can have as many properties as you want on a single account. For instance say you have three accounts. Two of these accounts have just one property associated with each one. The third account has four. If one of your clients has ten websites, you can add all ten websites to that client’s account as properties; one property associated with each one of the ten websites.

Each Property is assigned a tracking code and ID. The ID looks like this: UA-XXXXXXXX-X. Depending on which of the following methods you use, you’ll add either the code or ID to begin tracking Google Analytics. Here are descriptions of the two methods:

  • Add analytics code to the header.php file

  1. In the Google Analytics dashboard, go to Account > Property > Tracking Info > Tracking Code
  2. Copy the website tracking code
  3. In your WordPress admin dashboard, click on Appearance > Editor
  4. Locate and click on Header (header.php)
  5. Paste this code just before the closing </head> tag
  6. Click Update File

  • Install Google Analytics plugin

  1. In the Google Analytics dashboard, go to Account > Property > Tracking Info
  2. Copy the tracking ID, which is your property code
  3. In your WordPress admin dashboard, click on Plugins > Add New
  4. Search for and install the plugin called Google Analytics
  5. In your WordPress admin dashboard, click on Settings > Google Analytics
  6. In the Web Properties field, paste your property code
  7. Click Save Changes

Author: Patrick Greenough

I write and speak about marketing, leadership, and technology.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.