Skip to content

Instantly share code, notes, and snippets.

@javaadpatel
Last active August 5, 2020 15:43
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save javaadpatel/41a7044991ab108cbe784cb2fc575ce5 to your computer and use it in GitHub Desktop.
Google Analytics Netlify Function
//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