Here is a video guide specially made for Analytify WordPress Plugin users.
Following are the simple steps that can help you get your Google Client ID and Client Secret for your Web Apps or WordPress plugins from the Google Developers Console. We wrote this tutorial for Analytify users but It can be beneficial to everyone.
Steps to get Google Client ID and Client Secret
You need to create a Project in Google Developer Console. Click here to go to the Google Search Console web page. You will be asked to log in with your Google Account, if you are not logged in already.
If you don't have any projects already create in Google Developers Console, you will see the following screen.
Click on the “Create Project” button.
If you already have projects in your Google Developer Console, click on the project name in the top-left corner next to the Google Cloud Platform logo, a new pop-up window will open. Click on the “New Project” button to create a new project.
In either case, you will be redirected to the “New Project” page, where you will be asked to enter your “Project Name”, which will help you recognize your project in the console.
Add an appropriate name and click on the “Create” button.
Wait a couple of seconds while your project get created. You will see a notification when your project is ready.
Click on the “Select Project” link to enter the dashboard for the project you just created.
Now, you need to add two libraries to your project.
- “Google Analytics API” for analytics configuration.
- “Google Analytics Reporting API” for accessing reporting data.
In the navigation menu on left, hover over “APIs & Services” and click “Library”.
Search for “Google Analytics”. You should see the following results.
First, we will add the “Google Analytics API” library, so click on the “Google Analytics API” to go to the API page.
Click “Enable” to enable the API.
When enabled, you will be redirected to the Dashboard of the “Google Analytics API” library.
Now you have to add the “Google Analytics Reporting API” liberary. Click on the “Hamburger” menu to open the navigation menu. Hover over “APIs & Services” and click “Library” to go back to the library search page.
Again search for “Google Analytics” and click on “Google Analytics Reporting API”.
Just like before, click on the “ENABLE” button. when enabled, you will be redirected to the Dashboard of “Google Analytics Reporting API”.
This project need to be accessible externally. Click on the “Hamburger” menu to open the navigation menu. Hover over “APIs & Services” and click “OAuth consent screen”.
Set the “User Type” to “External” and click “Create”.
You will be redirected to the “App Registration” page. Add the following information:
- App name (you can just put ‘My Analytify Keys')
- User support email (select your email from the list)
- Email Address (Under “Developer contact information”, near the bottom. You can just put your own email here.)
Click “SAVE AND CONTINUE”.
After clicking “SAVE AND CONTINUE”, you will be taken to the “Scopes” page, you don't need to change anything here. Just click “SAVE AND CONTINUE”.
Now you will see the “Test User” page, you don't need to change anything here as well. Just click “SAVE AND CONTINUE”.
And finally, just click on “BACK TO DASHBOARD” to return to the “OAuth consent screen” dashboard.
You app is build but now it needs to be “Published”. To publish the app just click on the “PUBLISH APP” button.
A popup will ask for confirmation, just click “CONFIRM”. Your app is now published.
Analytify needs credentials to be able to access this app. From the left menu, click on “Credentials”.
Once you are on the “Credentials” page, click “CREATE CREDENTIALS” and then on “OAuth client ID”.
You will be redirected to the “Create OAuth click ID” page.
In another tab, open the “wp-admin” of your site. Go To Analytify > Setting > Advanced (tab).
The “Setup Custom API keys” should be set to “Yes”.
You can see the URL next to “Redirect URL”. Copy it, you will need it later.
Now back to the Google Console tab. Set the “Application type” to “Web Application”. In the “Name” field, you can just put “Analytify” and under “Authorized redirect URIs”, click the “ADD URI” button and add the URL from Analytify's Advance Setting page (that you just copied).
Your credentials have now been created.
On the Analytify's Advanced Setting page, put the “Click ID” and “Client Secret” that you got from Google into their respective fields. The “Redirect URL” will be the URL you see written below. Just copy and paste from there and “Save Settings”.
Next, you have to authenticate your Google Analytics account with Analytify, In order to do this go to Analytify Settings > Authentication and click on “Login with your Google Analytics Account”.
Note: If you are already logged in, you would have to logout first and then log in.
After clicking on “Log in with your Google Analytics Account” you will be redirected to Google Accounts Authentication page, you have to select your Google Account that is associated with your Google Analytics account.
In the next step, you will be asked to Allow the permissions. You have to click on the “Allow” button.
App Verification Alert
You may will get the “This app isn't verified” alert during the authentication of your Google account. You can continue without app verification by clicking on the “Advanced” option and on the “Go to *YOURDOMAINNAME* (unsafe)” link.
Although you can continue using an “Unverified App”, but if you like to get your app verified, click here and follow the steps.
You are now logged in. You will be redirected back to Analytify > Profiles here you need to select “Profiles for posts” and “Profile for dashboard”.
- “Profiles for posts” is the profile used for tracking users.
- “Profile for dashboard” is the profile used for showing stats on the Analytify's Dashboard.
For most people both these options will be the same. After selection, click “Save Changes”.
Congratulations! you have successfully implemented the Google Analytics APIs key for Analytics Tracking in Analytify. This is how you can get the Client ID and Client Secret key from Google Developers Search Console.
How To Verify The App
Follow the following steps to get your app verified on Google Console.
Open the Google Cloud Platform page. Open the dashboard of the project you just created (the project who's keys you are using in Analytify).
Click on the “Hamburger” menu to open the navigation menu. Hover over “APIs & Services” and click “OAuth consent screen”.
You will be taken to the Dashboard of the App you created. Click on the “EDIT APP” link.
Fill all the fields under “App domain”.
- “Application home page” is the link of your website's home page.
- “Application terms of service link” is the link to the terms of service page of your website.
After filling the information with the appropriate links, click “SAVE AND CONTINUE”.
You will be taken to the “Scopes” page, just click “SAVE AND CONTINUE”.
Again click “SAVE AND CONTINUE” on the “Optional info” page.
Lastly “BACK TO THE DASHBOARD” button on the “Summary” page.
Note: After you confirm or submit the app the Google Trust and Quality team will contact you through email to verify your property ownership through Google search console.
Google's trust and quality team will verify the data on your site and email you once they have verified your app.