🚠Fetch Google Analytics data with Google APIs in Node.js
- Add new Project from Google Console
- Create Credentials for your app (Select
Oauth Client ID=>Web application=>Create) - Config URIs & Authorized redirect URIs in Consent Screen
- URI example: http://localhost:6969
- Redirect URI example: http://localhost:6969/auth/callback
- Enable Google Analytics API (Go to Library => search
Analytics API=> Enable)
-
git clone https://github.com/hta218/nodejs-google-api-starter.git -
Config
.envfile (Using.env.example) -
yarn && yarn start -
Sign in, get your view and fetch data
-
Learn how to create your request with Google Analytics Reporting API v4