Set Up Analytics
Treepl CMS allows you to integrate Google Analytics views into the Admin Dashboard. This guide will help you configure your Google Analytics and your Treepl CMS site, so that the data is pulled from Google Analytics into the Admin area.
In order to configure the integration you, or your client, will need to have:
- A Google Account and valid Google Analytics property set up for the site
- A website instance on Treepl CMS
Configuring the Google Analytics dashboard will automatically add Google's tracking code to the included Google Tag Manager script output to your site. So you do not need to manually add the tracking code yourself.
Google Analytics API Project
To create a Google API project visit https://console.cloud.google.com/projectcreate
Set a name for your project.
Depending on your account, you may also be asked to assign a 'Billing account'.
'Organization' and 'Location' can be left as the default in most cases.
Once created you should see a notification popup with the new project listed.
Click on this project to further configure it.
In the absence of the notification link, you can navigate to the project using the project name dropdown at the top of the screen.
Once inside the project, click on the "Go to APIs overview" link.
Click "Enable APIs and Services" at the top of the screen.
In the search field, type 'Analytics' to filter the list of APIs available.
You should see results for both "Google Analytics Reporting API" and "Analytics API".
We'll need to enable both of these, however we'll start with the "Google Analytics Reporting API" so click on that item.
Once enabled, you should be brought to that APIs page where you can click "Create Credentials".
Here we can skip straight to creating a "service account" by clicking on that link.
Clicking on the three dot menu at the top right of the screen, choose "Create Service Account".
Provide a Service account name and description then click "Create".
Open the 'Select a role' dropdown and scroll down the left side list of items until you reach "Roles".
Hover/click on "Roles" and choose "Role Viewer" from the corresponding right side list.
Click "Create Key".
Leave "JSON" key type selected and click "Create".
Your Key will be generated and will either save to your downloads folder on your computer or you'll be asked where you'd like to save it (depending on your browser settings).
You'll need this file to upload to your Treepl CMS admin later, so keep it handy and file it in a safe place.
Close the confirmation dialog.
Your key should now be listed on the page and you can click "Done".
You should be returned to the Service Accounts screen where your new key is listed with a long email address (1).
Copy this email address now as you'll use it in the following steps when configuring your Google Analytics property.
Now, while here we'll click back to the Dashboard page (2) to enable the second API required.
Click "Go to APIs overview" link.
Click "Enable APIs and Services" at the top of the screen.
Again, search for 'Analytics' to filter the list of APIs available.
This time click on "Google Analytics API".
Click "Enable" and we are now done configuring the required APIs.
You can close out of the Google APIs page and continue to configuring your Google Analytics property with the following instructions.
Google Analytics configuration
This step requires that you, or your client, have a valid Google Analytics account set up. A free account can be created here if needed.
Log into your Google Analytics account https://analytics.google.com/.
Select the appropriate 'Analytics Account' and navigate across to the appropriate 'View' set up for your property.
Click "Admin" and navigate across to "User Management" under the 'View' column.
Click the "+" button at the top right of the screen to add a new permission.
Insert previously copied Service Account email, ensure 'Read and Analyze' permission is checked and then click "Add".
Go to 'View Settings' and copy the "View id" and paste it to a blank text document, or somewhere temporary. You'll need this shortly.
be sure to copy and paste the ID only as sometimes an extra blank space may also copy across, stoping the integration from working.
Go to 'Property Settings' and copy the "Tracking id".
again, be sure to copy and paste the ID only without any trailing spaces.
Set up Analytics in Treepl CMS
Go to Treepl admin -> Settings -> Setup Analytics and complete the form with the previously copied values:
- Tracking Id (not required *)
- View Id
- Service Account Key File
Your Service Account file may not display in the upload field, or show after saving, however it will still upload and be applied.
Troubleshooting Analytics Setup
Typically, the Analytics Dashboard in your Treepl CMS admin will not start display data straight away. It may take several hours for it to display and/or show any activity, showing some errors similar to "Data column(s) for axis #0 cannot be of type string". Allow 24hrs for the data to display.
If after this time you are still not seeing any activity reported, or are seeing other errors, try re-adding the Tracking and View IDs (ensuring no trailing spaces have copied over) and re-upload the Service key file. Then re-save the settings to apply the changes.
Additionally, some browser extensions/plug-ins such as Ad Blockers or security tools may stop the dashboard from working correctly. Try disabling any ad-blockers or security related extensions in your browser to test for this scenario.
Google Tag Manager
When adding your Google Analytics Tracking ID to the Analytics setup, Treepl CMS will automatically add the Google tracking script to the included Google Tag Manager script output to your site.
You do not need to manually add the tracking code yourself. However, if you'd prefer to add the tracking code yourself, or need to add a customised version of it, you can simply omit the Tracking ID from the Treepl CMS Analytics setup. The Analytics Dashboard will still display data so long as you've correctly added your custom Tracking code to your site.
There are currently no external resources available.
Please let us know if you have any other contributions or know of any helpful resources you'd like to see added here.
We are always happy to help with any questions you may have.
Send us a message at email@example.com and we will consult you as soon as possible.