Getting Advertising Account Stats
Account Stats are the total stats of all campaigns under one advertising account that has been connected to a specific Business Location in Advertising Intelligence.
For info on Business Locations see the Businesses guide
Setup
Create an access token with advertising scopes following the Authorization guide.
Examples
Fetching Account Stats For A Business
Account stats can be fetched for a single business location using its Business Location ID. This data can be used to provide an overview of a business's advertising performance. The following request will fetch stats for all advertising accounts connected to a given business. In this case, AG-X5FZQG6T25 has both Google and Facebook advertising accounts connected.
- Request
- Example Response
curl -X GET 'https://prod.apigateway.co/products/advertising/accountStats?businessLocation.id=AG-X5FZQG6T25' \
-H 'Authorization: Bearer <Access Token with "advertising" scope>' \
-H 'Content-Type: application/vnd.api+json'
For more details on this endpoint see List Account Stats
{
"data": [
{
"type": "accountStats",
"id": "AG-X5FZQG6T25:google:1324354698",
"attributes": {
"impressions": 5136,
"clicks": 99,
"conversions": 2,
"costMicros": 53000000,
"averageCostPerClickMicros": 535353,
"clickThroughRate": 0.019275,
"currencyCode": "CAD",
"provider": "google"
}
},
{
"type": "accountStats",
"id": "AG-X5FZQG6T25:facebook:act_63184543",
"attributes": {
"impressions": 5145,
"clicks": 66,
"conversions": 0,
"costMicros": 47000000,
"averageCostPerClickMicros": 712121,
"clickThroughRate": 0.012828,
"currencyCode": "CAD",
"provider": "facebook"
}
}
]
}
Filtering Stats By Date and Provider
By default, this endpoint will return stats for all time. If you want to get account stats for a specific date range, you can set startAt and endAt parameters.
Similarly, if you want to get stats for only one provider, you can set the filter[provider] parameter to either google, facebook or localAds.
This example will get stats from 2021-01-01 to 2021-02-01 for all Google Ads accounts connected to the business AG-JT87JWQ7KN.
- Request
- Example Response
curl -X GET 'https://prod.apigateway.co/products/advertising/accountStats?businessLocation.id=AG-JT87JWQ7KN&filter%5Bprovider%5D=google&startAt=2021-01-01T00%3A00%3A00Z&endAt=2021-02-01T00%3A00%3A00Z' \
-H 'Authorization: Bearer <Access Token with "advertising" scope>' \
-H 'Content-Type: application/vnd.api+json'
For more details on this endpoint see List Account Stats
{
"data": [
{
"type": "accountStats",
"id": "AG-JT87JWQ7KN:google:1348315432",
"attributes": {
"impressions": 1654,
"clicks": 52,
"conversions": 2,
"costMicros": 242350000,
"averageCostPerClickMicros": 4660577,
"clickThroughRate": 0.0314,
"currencyCode": "USD",
"provider": "google"
}
}
]
}