Configuring Google Analytics Integration

Members of the Admin role can use the Google Setup gadget to configure a connection to Google Analytics and to specify the analytics profile to use to track each site. When a profile is assigned to a site, any pages published for that site will contain the Google Analytics tracking script automatically. This allows you to ensure that all pages for your site will be tracked in your Google Analytics account without any additional overhead to you.

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 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 Manager
  5. Under 'Other popular APIs select Analytics API and click Enable API
  6. Select 'Credentials' from the left side of the screen
  7. Create a new Service Account by clicking 'Create credentials -> Service account key'
  8. Select Service Account and click the Create Client ID button
  9. Save the prompted .json file onto your file system
  10. Add permission to allow Service account access to Google Analytics. From the Google Analytics console (https://analytics.google.com), go to Admin - User Management and the Service Account email address that you just created, granting Read & Analyze permission.

Note: If you lose your JSON Key file, you can delete it from the service account and create a new replacement key.

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". At your next full publish this will generate all pages for this site without the GA tracking script

Leave a comment

*
*