Marketing Mix Modeling Breakdown on Insights API

The Marketing Mix Modeling Breakdown on Insights API is a self-service data extraction option that clients can use in order to export Meta ads data quickly and easily for marketing mix modeling 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. Unlike other breakdowns, it doesn't support 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, which is the default behavior (equivalent to the level=adset parameter). Currently the supported metrics for marketing mix modeling data are impressions and spend. Note: spend is an estimated metric. To learn more, see Insights API, Estimated and Deprecated Metrics.

Quickstart

To call the Insights API you need the ads_read permission for your given ad account.

To get the marketing mix modeling data:

curl \
  -F "access_token=ACCESS_TOKEN" \ 
  -F "breakdowns=mmm" \ 
  "https://graph.facebook.com/v21.0/act_AD_ACCOUNT_ID/insights"

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

This API call gets the daily marketing mix modeling data for the last week:

curl \
  -F "access_token=ACCESS_TOKEN" \ 
  -F "breakdowns=mmm" \ 
  -F "date_preset=last_7d" \ 
  -F "time_increment=1” \ 
  "https://graph.facebook.com/v21.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 would be 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.

  1. 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.
    curl \
      -F "access_token=ACCESS_TOKEN" \ 
      "https://graph.facebook.com/v21.0/BUSINESS_ID/owned_ad_accounts"
    
    curl \
      -F "access_token=ACCESS_TOKEN" \ 
      "https://graph.facebook.com/v21.0/BUSINESS_ID/client_ad_accounts"
    
  2. Iterate over the returned individual ad account IDs to query the marketing mix modeling data for each ad account.

Limits and Best Practices

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

For this release there is only a specific filtering supported for querying the marketing mix modeling data. Only these listed operator combinations are allowed for a field, and 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. However, note that some requests can time out even as an asynchronous job. For more information, see Insights API Asynchronous Jobs.

Please note that this release may have slightly different column header mappings and column header ordering than the Marketing Mix Modeling Data Export in Ads Reporting. Additionally, you 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