{"id":16525496,"url":"https://github.com/andrewn/realtime-analytics-feed","last_synced_at":"2026-05-10T18:09:25.161Z","repository":{"id":66464833,"uuid":"58936266","full_name":"andrewn/realtime-analytics-feed","owner":"andrewn","description":"Feed of Google Realtime Analytics data","archived":false,"fork":false,"pushed_at":"2016-06-06T09:55:00.000Z","size":298,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T14:53:01.206Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewn.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-16T13:52:33.000Z","updated_at":"2019-12-11T23:00:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"ab55b5a0-b14b-4a0b-8feb-72e65ac35052","html_url":"https://github.com/andrewn/realtime-analytics-feed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewn%2Frealtime-analytics-feed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewn%2Frealtime-analytics-feed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewn%2Frealtime-analytics-feed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewn%2Frealtime-analytics-feed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewn","download_url":"https://codeload.github.com/andrewn/realtime-analytics-feed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241601889,"owners_count":19989011,"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":[],"created_at":"2024-10-11T17:03:41.870Z","updated_at":"2026-05-10T18:09:25.127Z","avatar_url":"https://github.com/andrewn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Polls the [Google Analytics Real Time Reporting API](https://developers.google.com/analytics/devguides/reporting/realtime/v3/) every 10s for active users on a website and pushes that data via Server Sent Events.\n\nConfiguration\n---\n\nGoogle Analytics API credentials are supplied by a JSON file that contains the private key for a Service Account.\n\n0. Request beta access to the [Analytics Real Time Reporting API](https://developers.google.com/analytics/devguides/reporting/realtime/v3/).\n1. [Create a Service Account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount) for this application. The end result is a JSON file that's downloaded to you local machine.\n2. In the Google Analytics Admin interface, add the `client_email` email address as a user to your Analytics account. This will give this application access to the API.\n3. The JSON file can either be added as `credentials.json` in this directory or supplied as an environment variables called `CREDENTIALS_JSON` when starting the app.\n\nAuthorization\n---\n\nSet the AUTH_BASIC_USER and AUTH_BASIC_PASS env vars to require a username and password to access the event stream.\n\nDeploy to Heroku\n---\n\nYou can deploy this app to Heroku.\n\n     heroku create\n     git push -i heroku master\n     heroku config:set GA_ID=\"ga:12345678\"\n     heroku config:set CREDENTIALS_JSON=\"`cat credentials.json`\"\n\nVisiting your heroku app URL should show the data being pushed.\n\nSubscribe to the data source\n---\n\nThis app is designed to use [Server Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) which makes it very easy to use in a web browser.\n\n```js  \nvar source = new EventSource('http://your-app-name.herokuapp.com/')\nsource.onmessage = function (evt) {\n  var data = JSON.parse(evt.data);\n  console.log('New message: ', data);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewn%2Frealtime-analytics-feed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewn%2Frealtime-analytics-feed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewn%2Frealtime-analytics-feed/lists"}