How to Install Google Analytics to my WordPress Site: Part 1 of 2

08. November 2016 WordPress 0
How to Install Google Analytics to my WordPress Site: Part 1 of 2

A Step-By-Step Guide to install Google Analytics in your WordPress Site

You want Google Analytics in your WordPress site.  For this to work some JavaScript code must be served by every page in your website.  I didn’t want to make edits to my WordPress site source code so I was looking for a solution where I can install a Plugin to do it for me.  I found a great free plugin for WordPress called Google Analytics Dashboard that not only does this for you but it also adds Google Analytics to your WordPress Dashboard.  The problem I ran into was it was very confusing because you need to authorize the plugin with Google so that it can access the data in your account.  It took me a while to figure out how to do it, and I found myself doing it for every WordPress site I am setting up, so I thought I would share it with you.  I have included screenshots in this step-by-step guide so that it will be as easy as possible for you to follow along.  From time to time Google, the plugin, or WordPress itself may change. If you notice a screenshot is out of date or if you have trouble following along please let me know in the comments section.  It takes about 5-10 minutes to follow these steps.

 

Before you begin…

You must already have a WordPress site.  You can get one from WordPress.org, Godaddy.com or one of many other hosting companies.

You must also have a Google account (a Gmail account) that you activate Google Analytics for.  To get one for free go to www.google.com/analytics/.

What you will not do…

You will not edit any code or modify your website.  You will only be clicking buttons and doing a couple of copy-pastes.

What you are about to do…

You are going to install the Google Analytics Plugin for WordPress, a free Plugin.  You are also going to tell Google it’s OK to let this plugin access your Google Analytics data.  Google uses OAuth to manage account access.  You are about to use a technology called OAuth to tell Google it’s OK to let the Google Analytics Dashboard for WordPress piece of software talk to Google Analytics to access your data.  This is a non-permantent change to your WordPress website, you can always disable or remove the plugin and you can also revoke access to your data at any time from the Google Developers console.

Part 1 of 2: Create Credentials for the Google Analytics Dashboard Plugin

Step 1: You’ll need a Google API key.  Go to https://console.developers.google.com/apis/credential

Create a new project. There is a pull down on the top of the menu bar just to the right of the Google APIs logo.  Click the Create project button.

Pick a name for your project.  It doesn’t matter what the name is, but you can put something like WordPress-mysitename-com for your reference.

Once you’ve created your project you’ll be presented with all of the Google APIs.  You’ll want to select the “Analytics API“.

 

Select Google Analyitcs API

 

After clicking the link for Analytics API, you’ll see the ENABLE button at the top of the page.  Click the button to enable this API.

11-6-2016-1-14-23-pm

Next, click the Go to Credentials button.

Click Go To Credentials
Click Go To Credentials

 

You’ll see the screen titled “Add credentials to your project”. Click the Cancel button at the bottom.

11-6-2016-1-21-50-pm

Next click the Create Credentials pull down and select Create credentials and click OAuth client ID.

11-6-2016-1-22-21-pm

Click the Configure consent screen button.

11-6-2016-1-23-39-pm

Fill in the required fields on the OAuth consent screen then click the Save button.11-6-2016-1-26-47-pmNow you can create a client ID.  Select the Other radio button and type in a name like GA Dashboard Plugin and click the Create button.

 

Create Credentials using type Other
Create Credentials using type Other

 

You will now have your CLIENT ID and SECRET.  Copy and paste them into a file, do not lose them!  You will need them for Part 2.

Congratulations! You made it through Part 1!  

 

Kindly proceed to Step 2 of 2 where I’ll show you step-by-step how to install Google Analytics into your WordPress site.

How to Install Google Analytics to my WordPress Site: Part 2 of 2

 

 

 

 


Leave a Reply

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