{"id":22573203,"url":"https://github.com/morgant/bashalytics","last_synced_at":"2025-04-10T14:55:12.795Z","repository":{"id":15058183,"uuid":"17784375","full_name":"morgant/bashalytics","owner":"morgant","description":"A bash utility for fetching reports from Google Analytics using the Core Reporting v3 API","archived":false,"fork":false,"pushed_at":"2015-03-28T21:42:16.000Z","size":184,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T17:14:10.586Z","etag":null,"topics":["bash","google-analytics"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":false,"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/morgant.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}},"created_at":"2014-03-15T20:08:29.000Z","updated_at":"2019-07-11T17:08:27.000Z","dependencies_parsed_at":"2022-08-28T00:00:59.058Z","dependency_job_id":null,"html_url":"https://github.com/morgant/bashalytics","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/morgant%2Fbashalytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morgant%2Fbashalytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morgant%2Fbashalytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morgant%2Fbashalytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morgant","download_url":"https://codeload.github.com/morgant/bashalytics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248238782,"owners_count":21070573,"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":["bash","google-analytics"],"created_at":"2024-12-08T02:14:16.503Z","updated_at":"2025-04-10T14:55:12.776Z","avatar_url":"https://github.com/morgant.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"bashalytics\n===========\n\nby Morgan Aldridge \u003cmorgant@makkintosshu.com\u003e\n\nOVERVIEW\n--------\n\nA bash utility for fetching reports from Google Analytics using the Core Reporting v3 API. Also makes it easy to authenticate \u0026 cache an auth token as well as fetching \u0026 caching the list of dimensions \u0026 metrics.\n\n_While functional, this tool is currently under early development._\n\n\tINSTALLATION\n------------\n\nRunning the following command will install both bashalytics and the required JSON.sh in /usr/local/bin/:\n\n\t./install\n\nUSAGE\n-----\n\nFirst, authenticate to Google Analytics (this will store an auth token in ~/.bashalytics/auth_token):\n\n    bashalytics auth\n\nYou can run reports as follows (specifying the profile ID, followed by the start \u0026 end dates, followed by a list of dimensions \u0026 metrics):\n\n    bashalytics report \u003cprofile_id\u003e 2014-01-01 2014-01-10 ga:visits\n\nIt will output the report in TSV (tab separated values) format, with the first row specifying the column names as the dimensions \u0026 metrics that were specified, and the following row(s) containing the respective values. (Note: dimensions and metrics are fetched and cached locally once per day when running reports.)\n\nNaturally, you can get further usage instructions as follows:\n\n    bashalytics -h\n\nTO-DO\n-----\n\n* An option to override auth token (saving \u0026 reading) to support multiple accounts\n* Is there a way to look up \u0026 list Profile IDs?\n\nACKNOWLEDGEMENTS\n----------------\n\nOriginal concept based on [this blog post by Adam Buchanan](http://adambuchanan.me/post/19993272813/google-analytics-api-bash-scripts). Uses Google's [Core Reporting API (v3)](https://developers.google.com/analytics/devguides/reporting/core/v3/) and [Metadata API (v3)](https://developers.google.com/analytics/devguides/reporting/metadata/v3/) to fetch Google Analytics metrics, dimensions, and reports data, plus [Dominic Tarr's `JSON.sh`](https://github.com/dominictarr/JSON.sh) to parse JSON results.\n\nLICENSE\n-------\n\nCopyright (c) 2014-2015, Morgan Aldridge. All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorgant%2Fbashalytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorgant%2Fbashalytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorgant%2Fbashalytics/lists"}