/ua-backup

A script to backup Google Universal Analytics data to a CSV file

Primary LanguageJavaScript

ua-backup

A script to backup Google Universal Analytics data to a CSV file.

Installation

# env values described in below
cp .env.example .env

yarn
yarn run

ACCESS_TOKEN

Access token for calling Google Analytics API. Easiest way is to get it from Google OAuth 2 Playground.

  1. Go to Google OAuth 2 Playground
  2. Authorize on the scope https://www.googleapis.com/auth/analytics.readonly
  3. Generate the access token and copy to .env file

GA_ENDPOINT

Google Analytics Core Reporting API v3 endpoint. Can be generated using UA Query Explorer.

Reference