Skip to main content

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.

info

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.

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

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.

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