Git Product home page Git Product logo

wn-googleanalytics-plugin's Introduction

Google Analytics integration plugin

This plugin adds Google Analytics tracking and reporting features to the Winter CMS.

Configuration

Configure the API

To get started using Google Analytics API, you need to first create or select a project in the Google Developers Console and enable the API. Using this link guides you through the process and activates the Google Analytics API automatically.

Alternatively, you can activate the Google Analytics API yourself in the Developers Console by doing the following:

  1. Open the Credentials page.

  2. Select the Overview menu item and enable the Analytics API.

In either case, you should end up on the Credentials page and can create your project's credentials from here.

Create a client ID

  1. Open the Service accounts section of the Developers Console's Permissions page.

  2. Click Create service account.

  3. In the Create service account window, type a name for the service account, eg: Winter CMS Analytics.

  4. Place a tick in the box Furnish a new private key and select JSON for the Key type.

  5. Then, click Create.

  6. A .json file will be generated, this is the private key for your account. Accept the download and save it to your computer.

  7. Click Close.

  8. You should see an email ending with iam.gserviceaccount.com, if not select the Permissions tab. Copy this address to your clipboard.

Configure Google Analytics

  1. In a new tab, navigate to the main Google Analytics site and select the property you want to track.

  2. Click the Admin main menu tab at the top. Select the Property > User Management menu item.

  3. Paste the email address from the clipboard in to the field Add permissions for and make sure the permission is set to Read & Analyse. Click Add.

  4. Click the Admin main menu tab again and select View > View Settings from the menu. Copy to your clipboard the Profile ID (should be a number).

Configure Winter CMS back-end area

  1. Open your Winter CMS back-end administration area and open Settings > Google Analytics.

  2. Paste the Account ID from the clipboard in to the field Analytics View/Profile ID number.

  3. Upload the previously downloaded .json private key file to the Private key field.

  4. Specify the Tracking ID (eg UA-12312312-3) and Domain name values if you are going to use the plugin's built-in tracking component. To find this code, select Admin > Property > Property Settings from the Google Analytics menu.

  5. If Tracking is not working initially, enter the value auto for the Domain name field. This is a fix for newborn Google Analytics accounts.

Adding the 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 website 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' %}

Troubleshooting

Fix for Windows / XAMPP

cURL error 60: SSL certificate problem: unable to get local issuer certificate

  1. Follow this link: http://curl.haxx.se/ca/cacert.pem and save it in a file called cacert.pem.

  2. Open your php.ini file insert or edit the following line:

    curl.cainfo = "[pathtothisfile]\cacert.pem"
    
  3. Restart Apache

Popup message simply saying "error" when trying to add the JSON key file.

Some ad-blockers (such as Chrome's uBlock Origin extension or Firefox's own built-in algorithms) may prevent the uploading of the JSON file key. Disabling these, or whitelisting the Winter CMS website, may resolve this issue for you.

wn-googleanalytics-plugin's People

Contributors

acasar avatar alekseybobkov avatar alxy avatar ametad avatar blazorazem avatar bombozama avatar chocolata avatar daftspunk avatar eoler avatar gergo85 avatar grafxflow avatar jakobfdev avatar joelesvensson avatar kukrik avatar lieszkol avatar luketowers avatar mahony0 avatar matteotrubini avatar mirorauhala avatar mjauvin avatar mr118 avatar nemod503 avatar niekdemelker avatar norotaro avatar rebornishard avatar ribsousa avatar theservat avatar vojtasvoboda avatar xlink avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.