This module provides a simple dashboard of Google Analytics data, integrated into the Wagtail admin UI. Tested on Wagtail 1.4+.
- Create a service account and download the JSON key (Credentials > Create Credentials > API key)
- Make sure the Analytics API is enabled for your project (See issue 2)
- Add the service account email address as a read-only user in Google Analytics (Admin > User Management)
- Find the ID for your Google Analytics property (Admin > Property > View Settings, note: this is NOT the key that begins with "UA-")
- Store your JSON key somewhere safe, and do not check it into your repo
pip install wagalytics
- Add 'wagalytics' to your INSTALLED_APPS
- Add 'wagtailfontawesome' to INSTALLED_APPS if it's not there already
- Update your settings:
GA_KEY_FILEPATH = '/path/to/secure/directory/your-key.json'
or when using environment variables (e.g. Heroku):
GA_KEY_CONTENT = 'content_of_your_key.json'
GA_VIEW_ID = 'ga:xxxxxxxx'
If you get CryptoUnavailableError errors, you probably need to
pip install PyOpenSSL and/or
pip install pycrypto. See StackOverflow.
Ensure that your code snippet is included on each page you want to be tracked (likely by putting it in your base.html template.) (Admin > Property > Tracking Code)
Developers will need to carry out the following steps after cloning wagalytics:
- Ensure NodeJS & NPM are installed
npm run buildin the top level wagalytics directory
You will need to run
- allow configuration of results
- better styling, e.g. using chart.js
- Throw an error if the relevant settings aren't available
- add per-page results
- Thijs Kramer
- Stefan Schärmeli
- Alex Gleason
- James Ramm