Install Google Analytics in WordPress

November 11, 2016

This article is going to show you the easiest way to install Google Analytics in WordPress. There are two steps you need to follow:

  • Creating a Google Analytics account.
  • Install Google Analytics in WordPress.

What is Google Analytics and why it is so important for your blog?

Google Analytics is a freemium web analytics service offered by Google, which allows you to keep track of:

  • See your most important analytics data first.
  • Find out which online campaigns bring the most traffic and conversions.
  • Determine where your best visitors are located.
  • Learn what people are searching for on your site.
  • Visualize what people click on the most.
  • Uncover your top content.
  • Identify your worst performing pages.
  • Determine where people abandon the shopping cart.
  • Discover if you need a mobile site.

Creating a Google Analytics account.

If you do not have a Gmail account, then you would have to create an account for yourself (Create Gmail account here).

Next, go to Google Analytics Signup Page and log in using your Gmail account.

Follow the steps on the next screen to set up your Google Analytics account.

Once you have filled out all of the required information, you will be presented Google Analytics tracking code. You will enter that tracking code into your WordPress website later, so remember to highlight and copy the entire code snippet, as shown in the screenshot below.

Google Analytics tracking code

Install Google Analytics in WordPress

I’m focusing on two of the easiest and most popular methods.

1. Manual adding

Login to your WordPress website and go to “Editor” in the “Appearance” menu:

Wordpress admin editor menu

On the next screen, you need to find the file named: “header.php”. You can press  CTRL + F and search for “header.php”. Click to open it.

You will need to look for the following tag: </head> on the opened file. You can again use CTRL+F to search for it. Once you’ve found the tag, paste the tracking code snippet immediately before it. Click the “Update File” button once the Google Analytics tracking code is pasted in.

You can now click on the Reporting tab to see your site’s analytics overview. It takes Google up to 12 – 24 hours to start providing you with the awesome site stats that you need.

Google Analytics reporting

 

2. Using a plugin

There’re thousands of plugins out there can help you. But I’m going to show you how to setup Google Analytics by MonsterInsights plugin, which is one of the most powerful of the analytics plugins that is also very easy to setup and configure.

Install Google Analytics by MonsterInsights either via the WordPress.org plugin repository or by uploading the files to your server and activate it. (See instructions on how to install a WordPress plugin).

Navigate to the Analytics tab in your admin menu and configure the plugin.

GA Settings

On the settings page, you can see there’re two ways to add your Google Analytics tracking code:

GA Settings

 

Authenticate With Your Google Account (recommend):  click Authenticate with your Google account button, go through the prompts, and your account will be connected.

Manually Enter Your UA Code (you won’t be able to use the WordPress dashboards to display Google Analytics) : Check the “Manually enter your UA code” box.

Then go back to your Google Analytics account, click on the “Admin” link in the main menu, and then click on “Property Settings” under the center “Property” column. Then copy the code under “Tracking ID” (be sure to include the “UA” portion) and paste the code into the field in the plugin.

GA Settings - part 3

 

GA Settings - part 4

Click the “Save Changes” ! Again, allow 12-24 hours for data to populate.

Happy tracking!

Still having issues? Leave us a comment, so we can help.

 

Be the first to comment

Leave a Reply

Your email address will not be published.