Last active
August 5, 2020 15:43
-
-
Save javaadpatel/41a7044991ab108cbe784cb2fc575ce5 to your computer and use it in GitHub Desktop.
Google Analytics Netlify Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create jwt object | |
const jwt = new google.auth.JWT(process.env.GA_CLIENT_EMAIL, null, process.env.GA_PRIVATE_KEY, 'https://www.googleapis.com/auth/analytics.readonly'); | |
//authorize using jwt object | |
await jwt.authorize() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment