A Step-By-Step Guide to install Google Analytics in your WordPress Site
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“.
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.
Next, click the Go to Credentials button.
You’ll see the screen titled “Add credentials to your project”. Click the Cancel button at the bottom.
Next click the Create Credentials pull down and select Create credentials and click OAuth client ID.
Click the Configure consent screen button.
Fill in the required fields on the OAuth consent screen then click the Save button.Now 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.
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.