Configuring Google Analytics Integration

Configuring Google Analytics Integration

Members of the Admin role can use the Google Setup gadget to configure a connection to Google Analytics to specify an Analytics profile to use with the Dashboard gadgets.  To add Google Analytics or Google Tag Manager scripts to Page Templates, the script tag provided by Google must be added to the Template's Metadata->Additional Head Content.

Google Service Accounts

A Google service account allows an application developer to use OAuth2 to obtain and use information of a user who provides consent to their account. Information may include:

  • Basic Profile Information
  • Calendar Events
  • Email Contacts

Percussion CM1 will require a user to register their own application by creating a service account for their instance of CM1.

How to configure New account on Google Analytics(Admin Role)

  1. Go to Google Analytics (https://analytics.google.com)
  2. Click Admin >Click on create Account> Provide account name (select all check boxes under Account Data Sharing Settings) click on 'Next' Button
  3. Choose the required channel(web, mobile, etc.) and click on 'Next' Button
  4. Provide Website Name and URL and click on Create Button ,  select 'Google Analytics Terms of Service Agreement'.  
  5. New "Tracking ID" will get generated along with the script tag which user have to embed on all the page for which user wants to apply Google Analytics.

How to set up a Service Account

In order to use Google Analytics with CM1’s dashboard, you must configure at least one Service Account.

  1. Log in to Google Developer Console via https://console.developers.google.com
  2. Click the Create Project button (if you do not already have one)
  3. Fill out all required information
  4. From the menu on the top left, select the 'API  & Services'.
  5. Go to 'API Library' and select 'Google Analytics API' and click Enable API
  6. Go to 'API Library' and select 'Google Analytics Reporting API' and click Enable API
  7. Select 'Credentials' from the left side of the screen
  8. Create a new Service Account by clicking 'Create credentials -> Service account key'
  9. Select Service Account and click 'Create Key' button
  10. Save the prompted .json file onto your file system
  11. Add permissions to link your Service account to Google Analytics. Below are steps to add a user (https://support.google.com/analytics/answer/1009702?hl=en)
  • Sign in to Google Analytics(https://analytics.google.com)
  • Click Admin, and navigate to the desired account/property/view.
  • In the Account, Property, or View column (depending upon whether you want to add Users at the account, property, or view level), click User Management.
  • In the Account users list, click +, then click Add new users.
  • Enter the service Account email which you created on Google Developer Console (like : xxxxx@xx.iam.gserviceaccount.com) and Grant Read & Analyze permission.
  • Click Add

      

How to set up an API Key

In order to use google analytics with CM1’s dashboard, you must configure at least one service Account.

  1. Log in to Google Developer Console.
  2. Using the dropdown in the top left corner of your page, select your project.
  3. Fill out all required information.
  4. Select APIs & Auth > Credentials
  5. Create a new API key by clicking Create new Key.
  6. Select the Server key button in the displayed modal.

You can prevent requests from other clients such as a database or IP addresses to keep your requests sanitized.

Adding Google Analytics Reporting to your Site(s)

If you would like to receive constant updates on your website’s traffic through CM1, we recommend you configure the Google Setup Gadget and Traffic Gadget.

To setup a Google Setup Gadget:

  1. Navigate to the CM1 Dashboard
  2. Click Add Dashboard Gadgets under the finder.
  3. Click and drag Google Setup onto the dashboard under the gadget carousel.
  4. Click and drag Traffic onto the dashboard.
  5. Enter your Google Service Account Email into the Account Email input into the Google Setup Gadget.
  6. Using the file browser, locate your correct private key file. Note: Your key file must be a .json file provided by the Google Developer Console.
  7. Click the Connect button to validate your credentials. The button will be grayed out, but should turn blue when clicked.
  8. Note: if your credentials are invalid, CM1 will not allow you to save them.
  9. Click the Save button at the bottom right corner of the gadget.

You can now change your active viewing profile by using the dropdown box inside the gadget. The API key you just created can also now be added to the profile.

Removing Google Analytic Tracking

If you no longer want a given site to be be tracked in Google Analytics, in the Google Setup Gadget's section "Select a Google profile for each site" simply change the setting for your site back to "Select Google Analytics Profile".  Google Analytics / Tag Manager scripts added to Additional Head Content in Pages or Templates need to be removed, followed by a Full Publish of the site.