Skip to content

Instantly share code, notes, and snippets.

@mzagaja
Created October 20, 2020 00:01
Show Gist options
  • Save mzagaja/f94dc026bc1a5c50d61c9225c9af95d3 to your computer and use it in GitHub Desktop.
Save mzagaja/f94dc026bc1a5c50d61c9225c9af95d3 to your computer and use it in GitHub Desktop.

Connecting to Google Analytics API - A Journey

There is a Google Ruby client for doing this. They also have documentation.

  1. Follow the instructions for creating a service account.
  2. Add the service account to your Google Analytics account user list.
  3. Create a Project for your new API project if you wish. I usually do and name it something related to the project.
  4. Create a service account.
  5. Enable the Google Analytics Reporting API
  6. In GSuite Domain Security Settings go to API Controls and check "Trust internal, domain-owned apps."

Scope - Analytics Reporting v4

Actually follow the example here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment