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)

NOTE: The current version only supports Universal Analytics tags, not the new Version 4 (GA4) tags. If you are creating a new Analytics account to use with Percussion CMS, be sure to follow the steps below, as the default settings used by Google will not integrate with CMS at this time.

  1. Go to Google Analytics (https://analytics.google.com)
  2. Click Admin >Click on create Account> Provide account name (one account can have many sites). Select all check boxes under Account Data Sharing Settings, and click on 'Next' Button
  3. Create a new Property (website). Name it something related to the site name
  4. Important: Click "Show Advanced Options" above the Next button
  5. In advanced options, turn on the "Create a Universal Analytics property" switch
  6. Enter your website URL
  7. You can create both GA4 and UA properties, or the UA property alone; as long as you have a UA property, since that is required for the current Percussion CMS integration.
  8. Click Next, then answer questions about your business, click Create, and agree to Google's Terms
  9. A new "Measurement ID" will be generated, as well as the script tags that must be embedded for any page to be tracked by Google Analytics. If you created your property to use both GA4 and UA, the UA Tracking ID looks something like "UA-123456789-1"; that is the one you will need for CMS integration

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 (not the same as the API Key)
  7. Click the Connect button to validate your credentials. You will see a message indicating whether the connection was successful
  8. If the connection succeeded, you can select Google Analytics Profiles. For each site:
    1. Select the Profile from the dropdown - there should be at least one available
    2. Enter the API Key you created
  9. When you've entered a profile for each Site, click the Save button

You can now use other tools that rely on the Google Analytics integration, such as the Traffic Gadget (monitors website traffic) and the What's Working Gadget (compares traffic to publish history) - see Site Analytics.

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.