Follow

Analytics: Add Domain to Google Analytics

Analytics

When configured the Analytics Dashboard will provide high-level details on your website's statistics.

Enabling the API Access using Service Account

In order to rely on OAuth 2.0, our application must be authenticated and the user must grant access to it. To do so, several steps must be taken.

First, we need to log on to the Google Developers Console with our Google account and create a new project as seen below.

create_project.png

Name the project AdvantageCMS and leave the auto-generated Project ID as it is.

name_project.png

It will take a few seconds for the new project to be created.

Once the project is created, you will be redirected to its dashboard. Now, you need to enable the Analytics API and create a new access credentials.

enable_API-1.png

enable_API-2.png

After clicking on APIs in the left menu bar, you will be taken to the APIs list. Search for Analytics API and select and enable.

Once turned on, you will create new credentials by clicking the Credentials in the menu on the left.

credentials-1.png

Click on the Create Credentials button and Select the Service account key option.

credentials-2.png

This will take you to the Credentials detail page.

Under Service Account drop down, select App Engine default service account and select the P12 option and click Create.

credentials-3.png

A .p12 file will be downloaded to your computer and the service account key will be displayed under the service account keys list.

Click on the Manage Service Account link, on the far right, to check for the linked email.

credentials-4.png

Note the App Engine default service account email as seen below. This is the email address that needs to be entered in the CMS (Google login field) to set the analytics in the CMS.

service_account.png

Now that OAuth 2.0 access has been successfully created, the next step is to pair it with our website through Google Analytics.

Pairing with Google Analytics

The Reporting API credentials that have just been created can be used to access as many websites as you need to. All you need to do is add a new user for the desired website(s) using the Google Analytics User Management. As an email address, you need to use the email address that was generated for the OAuth 2.0 authentication in the previous step.

Therefore, you will use “568017249870-9pqlki56dvp3bn64hb2pnvlnais8ndes@developer.gserviceaccount.com” in the email TextBox while leaving the default Read and Analyze permission since that is all you need in this case.

Google_setup.png

Retrieve the website code

websiteCode: This is the code of the website we have paired with the Reporting API. To get the code, the fastest way is to navigate to the settings of the desired website in Google Analytics and copy the eight digit code following the letter “p” from the URL of the browser. 

 

Adding Google Client ID to Advantage CSP

  1. Go to Domain Management > Configurations Settings
  2. Go to the System tab
  3. Click on the pencil icon for Analytics
  4. Add in your Google Client ID and Site Code then click Save
  5. When you open the page, you will be prompted for security from Google

This is the implementation https://ga-dev-tools.appspot.com/embed-api/

To see an overview of the the dashboard when configured click the following article; Analytics: Dashboard Overview.

 

 

 

 

 

 

 

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments