Marketing Mix Modeling Breakdown on Insights API

The marketing mix modeling breakdown on the Insights API is a self-service data extraction option you can use in order to export Meta ads data quickly and easily without going through a Meta Marketing Science Partner or third-party agencies and mobile measurement partners.

The API calls are built into the Insights API using the breakdowns=mmm parameter. Note: It is not supported in combination with other breakdowns or action_breakdowns.

The responses contain similar metrics and breakdowns as results from the Marketing Mix Modeling Data Export in Ads Reporting. Marketing mix modeling data is available only on the ad set level (equivalent to the level=adset parameter). Currently, the supported metrics for marketing mix modeling data are impressions and spend. Note: The spend metric is estimated. See Insights API, Estimated and Deprecated Metrics for more information.

Permissions

You will need the following permissions for your ad account:

  • ads_read

Async Export Queries (Preferred)

Running an async export query using the export_format=csv parameter results in a downloaded file with column names that match those in Ads Manager.

Note: The time_increment can be set to 1 day (i.e., 1), otherwise all_time will be used by default.

Example request

curl GET \
  -F "access_token=<ACCESS_TOKEN>" \ 
  -F "breakdowns=mmm" \ 
  -F “export_format=csv” \
  -F "time_increment=1" \ 
"https://graph.facebook.com/v24.0/act_<AD_ACCOUNT_ID>/insights

Retrieve the Marketing Mix Modeling Data

Send a GET API call to the /insights endpoint with breakdowns=mmm.

curl GET \
  -F "access_token=<ACCESS_TOKEN>" \ 
  -F "breakdowns=mmm" \ 
"https://graph.facebook.com/v24.0/act_<AD_ACCOUNT_ID>/insights"

Note: The Insights API uses default values for parameters not specified in the call. We recommend using the time_range and date_preset parameters. The granularity of the response can be increased further by using time_increment.

Example request

TRetrieve daily marketing mix modeling data for the last week:

curl GET \
  -F "access_token=<ACCESS_TOKEN>" \ 
  -F "breakdowns=mmm" \ 
  -F "date_preset=last_7d" \ 
  -F "time_increment=1” \ 
"https://graph.facebook.com/v24.0/act_<AD_ACCOUNT_ID>/insights"

For more information about the Insights API and how to onboard to the Marketing API see the Insights API Quickstart.

Querying at the Business Manager Level

A common use case is to retrieve marketing mix modeling data for a single Business Manager. This operation isn't directly supported because the Insights API works on the ad account level and below.

To download data for a Business Manager you first need to query available ad accounts with the /owned_ad_accounts and /client_ad_accounts endpoints. Then iterate over the returned individual ad account IDs to query the marketing mix modeling data for each ad account.

Example requests

Using /owned_ad_accounts

curl GET \
  -F "access_token=<ACCESS_TOKEN>" \ 
"https://graph.facebook.com/v24.0/<BUSINESS_ID>/owned_ad_accounts"

Using /client_ad_accounts

curl GET \
  -F "access_token=<ACCESS_TOKEN>" \ 
"https://graph.facebook.com/v24.0/<BUSINESS_ID>/client_ad_accounts"

Limits and Best Practices

The granularity of marketing mix modeling data causes the response to have a large number of records as well as a substantial record size. This can cause your requests to time out during computation. To mitigate this, decrease the size of the request by using the time_range and filtering parameters and query for the total time range in sections. To learn more, see Insights API Limits & Best Practices.

Only specific filtering supported for querying the marketing mix modeling data. Only these listed operator combinations are allowed for a field; other usages of filtering will return an error.

FieldAllowed Operators

campaign.id

IN, NOT_IN

campaign.name

CONTAIN, NOT_CONTAIN

adset.id

IN, NOT_IN

adset.name

CONTAIN, NOT_CONTAIN

country

IN

region

IN

dma

IN

device_platform

IN

publisher_platform

IN

platform_position

IN

We recommend leveraging the Marketing Mix Modeling Data Export in Ads Reporting to export historical data if the API is not needed.

Alternatively, you can use the Insights API Asynchronous Jobs flow. This creates a job that computes the data in an asynchronous fashion. The endpoint responds with the id of an Ad Report Run, which you can query for the job status and to retrieve the computed data. Note: Some requests can time out even as an asynchronous job. For more information, see Insights API Asynchronous Jobs.

You may encounter slightly different column header mappings and column header ordering than the Marketing Mix Modeling Data Export in Ads Reporting. You also have full flexibility to join the marketing mix modeling breakdown's default data with other tables queried from the API.

Column IndexDefault Column Headers from Marketing Mix Modeling Breakdown

0

account_id

1

campaign_id

2

adset_id

3

date_start

4

date_stop

5

impressions

6

spend

7

country

8

region

9

dma

10

device_platform

11

platform_position

12

publisher_platform

13

creative_media_type