{"id":13449292,"url":"https://github.com/tomdyson/wagalytics","last_synced_at":"2025-04-05T02:09:45.196Z","repository":{"id":4234923,"uuid":"52445730","full_name":"tomdyson/wagalytics","owner":"tomdyson","description":"A Google Analytics dashboard in your Wagtail admin","archived":false,"fork":false,"pushed_at":"2023-01-06T01:33:53.000Z","size":1122,"stargazers_count":221,"open_issues_count":30,"forks_count":42,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-01T11:48:56.508Z","etag":null,"topics":["google-analytics","wagtail"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomdyson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-24T13:48:14.000Z","updated_at":"2025-02-28T11:24:12.000Z","dependencies_parsed_at":"2023-01-13T13:01:17.276Z","dependency_job_id":null,"html_url":"https://github.com/tomdyson/wagalytics","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomdyson%2Fwagalytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomdyson%2Fwagalytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomdyson%2Fwagalytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomdyson%2Fwagalytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomdyson","download_url":"https://codeload.github.com/tomdyson/wagalytics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-analytics","wagtail"],"created_at":"2024-07-31T06:00:35.116Z","updated_at":"2025-04-05T02:09:45.181Z","avatar_url":"https://github.com/tomdyson.png","language":"Python","funding_links":[],"categories":["Python","Apps"],"sub_categories":["Analytics"],"readme":"# Wagtail Analytics\n\n(Last Updated 12/17/19 for Wagtail v2.x)\n\nThis module provides a simple dashboard of Google Analytics data, integrated into the Wagtail admin UI. Tested on Wagtail 2.0+.\n\n![Screenshot](screenshot.png)\n\n![Screenshot](wagalytics-page-stats.png)\n\n## Instructions\n\n1. [Create a service account](https://ga-dev-tools.appspot.com/embed-api/server-side-authorization) and download the JSON key (Credentials \u003e Create Credentials \u003e API key)\n1. Make sure the [Analytics API is enabled for your project](https://console.developers.google.com/apis/api/analytics.googleapis.com) (See [issue 2](https://github.com/tomdyson/wagalytics/issues/2))\n1. Add the [service account email address](https://console.developers.google.com/permissions/serviceaccounts) as a read-only user in Google Analytics (Admin \u003e User Management)\n1. Find the ID for your Google Analytics property (Admin \u003e Property \u003e View Settings, note: this is NOT the key that begins with \"UA-\")\n1. Store your JSON key somewhere safe, and do not check it into your repo\n1. `pip install wagalytics`\n1. Add 'wagalytics' to your INSTALLED_APPS\n1. Add 'wagtailfontawesome' to INSTALLED_APPS if it's not there already\n1. Update your settings:\n - `GA_KEY_FILEPATH = '/path/to/secure/directory/your-key.json'`\n\n or when using environment variables (e.g. Heroku):\n - `GA_KEY_CONTENT = 'content_of_your_key.json'`\n - `GA_VIEW_ID = 'ga:xxxxxxxx'`\n\nIf you get CryptoUnavailableError errors, you probably need to `pip install PyOpenSSL` and/or `pip install pycrypto`. See [StackOverflow](http://stackoverflow.com/questions/27305867/google-api-access-using-service-account-oauth2client-client-cryptounavailableerr).\n\nEnsure that your code snippet is included on each page you want to be tracked (likely by putting it in your base.html template.) (Admin \u003e Property \u003e Tracking Code)\n\n## Multisite Support\n\nTo enable multisite support you'll need to update your Wagalytics settings _and_ have `wagtail.contrib.settings` installed. Sites can use a `GA_KEY_FILEPATH` or a `GA_KEY_CONTENT` key, but it's best not to use both.\n\nIn the snippet below, you'll see `site_id`. This is the ID (Primary Key) of your Wagtail Site.\n```python\n# Use either the GA_KEY_FILEPATH or the GA_KEY_CONTENT setting on your sites,\n# but don't use both\nWAGALYTICS_SETTINGS = {\n    site_id: {\n        'GA_VIEW_ID': 'ga:xxxxxxxx',\n        'GA_KEY_FILEPATH': '/path/to/secure/directory/your-key.json',\n    },\n    site_id: {\n        'GA_VIEW_ID': 'ga:xxxxxxxx',\n        'GA_KEY_CONTENT': 'content_of_your_key.json',\n\t}\n}\n```\nFor every Wagalytics site you add in your multisite `WAGALYTICS_SETTINGS` you'll need to make sure you have the proper GA View ID and API Key. One View ID and API Key won't work for all your sites automatically.\n\nHere's a working example of multisite WAGALYTICS_SETTINGS:\n\n```python\nWAGALYTICS_SETTINGS = {\n\t# My default site. 2 is the site ID. This one uses GA_KEY_FILEPATH.\n    2: {\n        'GA_VIEW_ID': 'ga:xxxxxxxx',\n        'GA_KEY_FILEPATH': '/path/to/secure/directory/your-key.json',\n    },\n    # The secondary site. 3 is the Site ID. This one uses GA_KEY_CONTENT.\n    3: {\n        'GA_KEY_CONTENT': 'content_of_your_key.json',\n        'GA_VIEW_ID': 'ga:xxxxxxxx',\n    }\n}\n```\n\n## Wagalytics Developers\n\nDevelopers will need to carry out the following steps after cloning wagalytics:\n\n- Ensure NodeJS \u0026 NPM are installed\n- Run `npm install` then `npm run build` in the top level wagalytics directory\n\nYou will need to run `npm run build` anytime the javascript source is updated.\n\n### TODO\n\n - [ ] allow configuration of results\n - [x] better styling, e.g. using [chart.js](https://ga-dev-tools.appspot.com/embed-api/third-party-visualizations/)\n - [ ] Throw an error if the relevant settings aren't available\n - [x] add [per-page results](https://github.com/tomdyson/wagalytics/issues/12)\n\n### Notes\n\nThis module doesn't help with recording user activity. See [the Wagtail docs](http://docs.wagtail.io/en/latest/topics/writing_templates.html?highlight=analytics#varying-output-between-preview-and-live) and [StackOverflow](http://stackoverflow.com/a/1272312/181793) for pointers on how to avoid gathering data during preview and testing.\n\n### Contributors\n\n - Thijs Kramer\n - Stefan Schärmeli\n - Alex Gleason\n - James Ramm\n - Jake Kent\n - Kalob Taulien\n - Julius Parishy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomdyson%2Fwagalytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomdyson%2Fwagalytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomdyson%2Fwagalytics/lists"}