Reporting API is used in order to receive Google Analytics data. Service-account key and view ID must be provided by the client. Below you can find all the information on how the client can get necessary data.
- Setting API
Before you start the work, use setting tool in order to create a Google API Console project, enable API, and register your account credentials.
- Generating service-account credentials
1. Open the Service accounts page. If prompted, select a project.
2. Click Create service account.
3. In the Create service account window, type a name for the service account, and select Furnish a new private key.
Your new public/private key pair is generated and downloaded to your machine; it serves as the only copy of this key.
- Connecting Service account with Google Analytics account
The new service account will obtain email alike with the following:
Use this email for adding a user to the Google Analytics view to which you need an access through API.
- Retrieving view ID
Use Account Explorer in order to retrieve necessary view ID.
Limitations in present integration with Google Analytics
1. Service-account key and view ID get connected to Facebook account. Thus, one view corresponds with only one Facebook account. Combining several views under one Facebook account is not yet supported. Secret key also gets connected to the Facebook account.
2. Difference between Google Analytics and Facebook Account time zones is not considered. In order to get information about time zone you will need an access to Management API.
3. There is a limitation in API method used for getting reports: four or less inquiries in a pack. Potentially it can decrease data retrieving speed in the case of large ads amount. Overcoming this limitation by asynchronous inquiries sending is not yet supported.
4. Because of announced inaccuracy in the last few hours data Google Analytics can be used in automations only when using data for a previous day.
5. Facebook and Google Analytics entities get connected by UTM-parameters. The following correspondence is currently used: