credentials_file
optional, is a path to the JSON file that stores credentials to the Google account.credentials_json
: optional, is the content of the JSON file that stores credentials to the Google account.property_id
required, is the property id of your Google Analytics website. Here is some information on how to get the property id.⚠️ One of credentials_file or credentials_json has to be chosen.
Create
to create the new project.
APIs & Services
> Library
.
2.3 In the search bar, search for Google Analytics Admin API
.
2.4 Click on Google Analytics Admin API
, then click Enable
.
APIs & Services
> Credentials
.
3.2 Click on the Create Credentials
button and choose Service account
.
3.3 Enter a unique Service account ID
.
3.4 Click Done
.
3.5 Copy the service account you created. Find it under Service Accounts
.
3.6 Now click on the service account you created, and navigate KEYS
3.7 Click ADD KEY
> Create new key
.
3.8 Choose JSON
then click CREATE
3.9 After this the credentials file will be downloaded directly. Locate the file and use the location to it in the credentials_file
param.
Admin
panel.
4.3 Navigate Account
> Account Access Management
.
4.4 Click on the ”+” icon to add a new user.
4.5 Enter the service account you copied in step 3.5 as the email address.
4.6 Assign the appropriate permissions to the service account. At a minimum, you’ll need to grant it Edit
permissions.
4.7 Click on the Add
button to add the service account as a user with the specified permissions.
conversion_events
table.
Now you can use your Google Analytics data like this: