Skip to main content

Getting Advertising Campaign Stats

Campaign Stats are the stats of connected campaigns under one advertising account that has been connected to a specific Business Location in Advertising Intelligence. In order to access campagin level information or stats, the Business Location must have advanced reporting enabled.

Setup

Create an access token with advertising scopes following the Authorization guide.

Examples

Fetching all Campaign Stats for a connected account

In order to fetch campaign stats for an account, you will need the ID of a Connected Account.

info

For info on Connected Advertising Accounts see the Connected Accounts guide

The ID will be in the format AG-X5FZQG6T25:google:1324354698

curl -X GET 'https://prod.apigateway.co/products/advertising/campaignStats?connectedAccount.id=AG-X5FZQG6T25%3Agoogle%3A1324354698' \
-H 'Authorization: Bearer <Access Token with "advertising" scope>' \
-H 'Content-Type: application/vnd.api+json'

For more details on this endpoint see List Campaign Stats

Filtering Stats By Date

By default, this endpoint will return stats for all time. If you want to get campaign stats for a specific date range, you can set startAt and endAt parameters.

This example will get stats from 2021-01-01 to 2021-02-01 for all campaigns under the connected account AG-X5FZQG6T25:google:1324354698

curl -X GET 'https://prod.apigateway.co/products/advertising/campaignStats?connectedAccount.id=AG-X5FZQG6T25%3Agoogle%3A1324354698&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 Campaign Stats