A script to backup Google Universal Analytics data to a CSV file.
# env values described in below
cp .env.example .env
yarn
yarn run
Access token for calling Google Analytics API. Easiest way is to get it from Google OAuth 2 Playground.
- Go to Google OAuth 2 Playground
- Authorize on the scope
https://www.googleapis.com/auth/analytics.readonly
- Generate the access token and copy to
.env
file
Google Analytics Core Reporting API v3 endpoint. Can be generated using UA Query Explorer.