Google Analytics Reporting API (v4)
Getting started
In order to start using the hibase connector to the Google Analytics API (v4), you first need to set up a Service Account within your Google Analytics account.
Navigate to your Google APIs Dashboard and check whether a Project already exsists for your app
If a project was not already set up, you can do so through this Setup tool
Navigate to the Google APIs Library and activate the Google Analytics Reporting API for the project if it was not already activated
Navigate to the Credentials tab and select Create credentials -> Service account key
Save your credentials as JSON. Warning: Store this file securely as this is the only time you will be able to download it
You will now have to add the newly created user to your Google Analytics account. Sign in, click on Admin in the bottom-left corner and then on User Management under the account / property or view you want to give hibase access to
In the Account users list, click on + in the top-right corner and then on Add new users
As an email address, enter the
client_emailthat you see in the JSON file saved at step 5. As permissions, select Read & AnalyzeBack to hibase, add a new Google Analytics API (v4) Connector and fill your client email and private key, which you can find in the downloaded JSON file
Important: make sure you correctly add line breaks to your private key, by substituting any occurrence of \n in the JSON file with an actual line break. From:
-----BEGIN PRIVATE KEY-----\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\nXXXXXXXXXXXXX...
... to:
-----BEGIN PRIVATE KEY-----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXX...
- Save the connector and you are good to go
In case you experience issues querying the API, check again the steps above and especially that you copied your private key correctly (step 6). You can edit the Connector you just added at any time and overwrite the credentials you originally provided.