This plugin adds Google Analytics tracking and reporting features to the OctoberCMS.
Google Analytics API uses the OAuth security. In order to use the plugin you need create a Google API application.
- Go to the Google API Console and create a new project.
- On the project page go to the APIs & auth / APIs section and enable Analytics API.
- Go to the APIs & auth / Credentials section on the project page and click the Create New Client ID button. In the popup window select the Service account option. The private key will be downloaded to your computer automatically.
- Copy the email address ([email protected]) from the OAuth / Service Account section and add it to your Google Analytics property you want to be able to access from OctoberCMS.
- In the OctoberCMS back-end go to the System / Settings page and click the Google Analytics link.
- Enter the Google API Project name, Google API Client ID, the generated email address and add the downloaded private key to the Google Analytics settings form.
- Specify the Tracking ID and Domain name values if you are going to use the plugin's built-in tracking code.
Using the tracking code provided by the plugin is optional - the reporting part does not depend on whether you track your traffic with the built-in tracker or with a custom code generated by Google Analytics tools.
To add the plugin's tracking code to your weisbte just drop the Google Analytics Tracker component to your CMS layout and add this code to the layout code after the page tag:
{% page %}
{% component 'googleTracker' %}