Last updated 15 August 2015. Created on 15 August 2015.
Edited by jasom. Log in to edit this page.

Here's a 3 minute video tutorial about how to get Goolge "Client ID" and "Client Secret" required by the Google Analytics Counter module.

If you cannot watch a video, use this step-by-step text-image guide:

1. Log into your Google account tied with GA and visit the Google API Console. Next to the "Google Developers Console" logo, click on the selection and choose "Create a project...".

Google Developers Console - Create a project.

2. Type in a "Project name". Under "Show advanced options..." you can decide whether "App Engine location" will be in US or EU.

Google Developers Console - New project.

3. As soon as you click on the blue "Create" button, white lightbox will be closed and  you will see the status of the activation process in the right-bottom corner of your screen.

Status of the activation process

4. When done, you will be automatically redirected inside app's "Overview" (in my case it's "YnterviewComGAapi"). Go to "APIs & uuth" > "APIs" and click on "Analytics API".

Analytics API

5. Clink on blue "Enable API" button. When button will change from blue to white with the text "API Enabled", continue to the step 6.

Enable API

6. Go to "Creadentials" click on the "Create new Client ID" button.

 Create new Client ID

7. Select "Web application" as your "Application type" and clink on the "Configure consent screen" button.

Application type

8. Only required field in "Consent screen" page is "Product name". Don't waste time filling out other items, nobody except you will ever see this. Click on the blue "Save" button on the bottom of the page.

Consent screen

9. You will be again redirected to "Create Client ID" page. Fill our "Authorized JavaScript origins" and "Authorized redirect URIs".  You will find your "Authorized redirect URIs" in Google Analytics Counter's tab marked as "GA authentication" (admin/config/system/google_analytics_counter/authentication) in the description of "Redirect host" field (search for "Current redirect URI"). It will be something like htt p:// When done, click on the "Create Client ID" blue button.

NOTE: I made a mistake and forgot to add "www" in my URL. Later, it will end up with an error message, but let's continue for now.

Set callbacks

10. Now you finally have a "Client ID" and "Client secret" within GAC module.

Client ID and Client Secret

11. Go to "GA authentication" tab in Google Analytics Counter module settings (admin/config/system/google_analytics_counter/authentication), copy "Client ID" and "Client secret", and then hit the "Start setup and authorize account" button.

If all went well you will see a page like that in step 13. However, as I mentioned in step 9, I made a mistake, and I saw an error page saying "the redirect URI in the request did not match a registered redirect URI" ("www" was missing). I left this mistake as part of the tutorial, because I believe it will be helpful for you.

NOTE: If you are not logged in, you will be asked to log into your Google developer account (account connected with the API).

Error page saying "the redirect URI in the request did not match a registered redirect URI"

12. Go back to the page where you copy "Client ID" and "Client secret" from and click on "Edit settings" white button. Fix the settings and click on the blue "Update" button. Refresh (reload, F5) the error page and continue to the next step.

Edit client settings

13. Click on the "Accept" button.

Accept page

14. That's it, you have been successfully authenticated. Now select a proper "Report profile" (I have more sites in my GA account), and click on the "Save settings" button.

Select a proper "Report profile"

15. Within Google Analytics Counter settings, go to the "Dashboard" tab and click on the "Run cron immediately" link. After a successfull Cron run all your Google Analytics statistics will be loaded and it means that you successfully got Client ID and Client Secred + connected GAC module with GA.


Looking for support? Visit the forums, or join #drupal-support in IRC.


rizaladitiyosup’s picture

not worked for