Here are the steps necessary to configure your Ektron site with Google Analytics.
Create a Google Analytics User Account
- Create a Gmail account (http://mail.google.com).
- Sign up for Google Web Analytics (www.google.com/analytics/).
- Open a browser and navigate to https://code.google.com/apis/console .
- Click Create project.
- Turn on Analytics API. Agree to terms of service.
Prepare the web.config
- In the web.config remove the existing 3.0 Google analytics section(search for GoogleV3.0).
- Replace it with this one to make it more readable and to remove unnecessary fields.
- <add name="GoogleV3.0"
type="Ektron.Cms.Analytics.Providers.GoogleAnalyticsProviderv3,Ektron.Cms.BusinessObjects"
EmailAddress=""
KeyFilePassword=""
KeyFilePath=""
ProfileId=""
SiteURL=""
UserAccount=""
Endpoint="https://www.googleapis.com/analytics/v3/data/"
CacheInterval="0"
GoogleAnalyticsTrackingCodePath="Analytics\template\googletrackingcode.ascx"
Version="3.0"
/>
Generate key file and email account
Google analytics is not compatible with versions prior to 9.0 as the previously used public key method is no longer functional due to Google's shutdown of OpenID 2.0. Pages can still be tracked in pre-9.0 versions using Google's tracking code, but the analytics reporting in Ektron will not display results.
Generate a key file
- Go to https://console.developers.google.com/cloud-resource-manager
- On the left menu click APIs & Services.
- Click VIEW ALL.
- Search for Analytics API.
- Select Analytics API.
- Click ENABLE.
- On the left menu click Credentials.
- Click Create credentials and select Service account key.
- Click the Service account dropdown and click new service account.
- Provide a service account name which should automatically make a service account ID. Do not select a Role.
- For the Key type choose the P12 type and hit Create.
- Click CREATE WITHOUT ROLE.
- A new key is created. Save it to the site.
- Enter the path of the key in the web.config's KeyFilePath field. If you saved the key in the root of the site it would look like this.
KeyFilePath="/<key_name>.p12" - A message regarding the private key password appears. The private key password is notasecret for all service account keys.
- In the web.config enter notasecret in the KeyFilePassword field.
- Click Manage service accounts in the bottom right of the Credentials screen.
- Copy the email address on the Service accounts screen into the web.config's EmailAddress field.
Update 5/12/2022
P12 keys now require a separate procedure to download.
"Inside Google Cloud Console:
- Open the project, go to
APIs & auth
>Registered apps
on the left. - Click on
Register App
, enter name and choose platform (for e.g.Web Application
). - On the next page, open
Certificate
and click onGenerate Certificate
and download the.p12
private key.
Don't forget to note the email address and password that appear when downloading the key.
To access google analytics with this key, you also need to give permission to the above email address in your analytics account.
- In Google Analytics, open the site's reporting section and click on
Admin
link on top-right. - Under
User Management
, addRead & Analyze
permissions for the email address you noted previously."
Analytics Account Setup
In order for analytics integration to work you will need to give the google analytics user the proper permissions. Please note that the user used to authenticate with OAuth 2.0 is not the same user used to setup the project. Instead it is the user we created in the last section.
- Go to https://analytics.google.com/analytics/web/.
- Click Sign up.
- Enter in the requested info.
- Click Get Tracking ID.
- On the next page you will see the Property column(if you already had an analytics account, click the ADMIN button in the bottom left to access the Property column).
- Copy the Tracking ID into the UserAccount field of your web.config.
- In the same Property column, click User Management.
- Click the + button and add a new user.
- Enter the email address from the EmailAddress field of the web.config.
- Give that user Edit permissions.
- In the top right click Add.
- Go back to the page with the three columns. Click on the View Settings column.
- Copy the View ID field into the ProfileID field of the web.config.
- On the same page copy the Website's URL field into the SiteURL field of the web.config.
If an existing Google Analytics account is being used an older user interface may be displayed.
The below steps are for the older user interface
Create a Google Analytics User Account
- Create a Gmail account (http://mail.google.com).
- Sign up for Google Web Analytics (www.google.com/analytics/).
- Open a browser and navigate to https://code.google.com/apis/console .
- Click Create project.
- Turn on Analytics API. Agree to terms of service.
Generate key file and email account
Google analytics is not compatible with versions prior to 9.0 as the previously used public key method is no longer functional due to Google's shutdown of OpenID 2.0. Pages can still be tracked in pre-9.0 versions using Google's tracking code , but the analytics reporting in Ektron will not display results.
Generate a key file
- Go to https://code.google.com/apis/console .
- Click APIs & auth.
- Click Credentials.
- Click add credentials > service account.
- Select the P12 option.
- Click create.
- Download the key file.
- Create a new folder in your web root called Key and save the file there.
- In the web page click ok on the resulting prompt.
- Copy the email address field into a text editor for later use.
Analytics Account Permissions
In order for analytics integration to work you will need to give the google analytics user the proper permissions. Please note that the user used to authenticate with OAuth 2.0 is not the same user used to setup the project. Instead it is the user we copied in step six of the last section.
- Go to https://www.google.com/analytics/ and hit the access Google Analytics button.
- Click Admin- it is located in the top menu.
- You will see three columns. In the Property Column, click user management. Make certain the correct user account ID is selected(the user account ID is a string prepended with UA).
- In the Add permissions for: field add the email of the user you copied. If you just want the bare minimum permissions for reading analytics info in Ektron, choose read & analyze.
- Click Add.
Enter Configuration Info
- Now that we're finished adding permissions we can enter the Google configuration information to our site's web.config. Search for AnalyticsDataProvider until you see several add tags with different configuration information. Copy and paste this google analytics section below the tag.
<add name="GoogleV3.0" type="Ektron.Cms.Analytics.Providers.GoogleAnalyticsProviderv3,Ektron.Cms.BusinessObjects" EmailAddress="" KeyFilePassword="" KeyFilePath="" ProfileId="" SiteURL="" UserAccount="" Endpoint="https://www.googleapis.com/analytics/v3/data/" CacheInterval="0" GoogleAnalyticsTrackingCodePath="Analytics\template\googletrackingcode.ascx" Version="3.0" /> - Under the name field enter any name you would like. This is just a label and should not impact functionality.
- In the EmailAddress field, enter the email address copied into your text editor.
- In the KeyFilePassword field, enter notasecret.
- For KeyFilePath put in the path of the key file relative to your site root. Eg: /Key/xxxxxxxxx.p12
- Go back to the Analytics Administration window( https://www.google.com/analytics/ and click admin), ensure that the correct user go into the view column, click settings and copy the number under View ID. Paste this into the profile ID field.
- While we're still in the settings page, and copy the Website's URL field into the SiteURL field of the web.config. Do not add http://
- Click the back button, click property settings under the property column, copy the tracking ID field, and add it to the user account field.
- Save the web.config and load your workarea. If there is analytics data, you should see it at this point. If not, carefully go through your analytics settings to confirm there are no typos.
Please sign in to leave a comment.