Skip to main content

Community

Connector Improvement: Facebook Ads Results

Answered

Please sign in to leave a comment.

Comments

3 comments

  • Official comment

    Hi Jake and Barbara,

    Sorry for the delay. But I have good news: the data you need to reconstruct the "Result" metric is already available through the Fivetran Facebook Ads connector. It has always been there; it's just complicated to find because of how Facebook's API is set up.

    Background: What is the "result" metric?
    The "result" column you see in Facebook Ads Manager is a computed metric that selects the specific action count corresponding to your campaign's optimization objective. For example, if your campaign objective is "Link Clicks," the Result column shows the count of link_click actions; if your objective is "Leads," it shows leads.

    The Meta Marketing API provides a field called objective_results that replicates this same logic, returning the result scoped to your campaign's objective so you don't have to manually map objectives to action types. Fivetran can sync this field via a Custom Report. Here are two approaches depending on your needs.

    Option 1: Create a Custom Report with objective + objective_results (recommended, simplest approach)
    The most direct way to get the "result" is to create a Custom Report in your Fivetran Facebook Ads connector that includes both the objective and objective_results fields. This will produce two tables:

    1. A parent table (e.g., your_report_name) with a row per campaign/date and an objective column showing the campaign objective (e.g., LINK_CLICKS, OUTCOME_LEADS)
    2. A child table (e.g., your_report_name_objective_results) with columns:
    • indicator: describes what the result is (e.g., actions:link_click, conversions:start_trial_website)
    • attribution_window: the attribution window (e.g., default, 7d_click)
    • value: the result count

    The objective_results field returns exactly one result type per campaign/date, corresponding to your campaign's optimization objective. The value column on the default attribution window row is your "result" You don't need to manually map objectives to action types; Meta's API does this for you.

    To get the "result" value, simply join the two tables on campaign_id and date, and filter for attribution_window = 'default':

    SELECT
      parent.campaign_id,
      parent.date,
      parent.objective,
      child.indicator,
      child.value AS result
    FROM your_report_name parent
    JOIN your_report_name_objective_results child
      ON parent.campaign_id = child.campaign_id
      AND parent.date = child.date
    WHERE child.attribution_window = 'default'

    To set up a Custom Report, navigate to your Facebook Ads connector in the Fivetran dashboard, go to the Schema tab, and configure a new custom report with the fields you need.

    Option 2: Using the basic_all_levels_actions child table

    If you prefer to use the existing prebuilt basic_all_levels report, the "result" data is also available in the basic_all_levels_actions child table. This table contains all action types for each ad/date:

    • action_type: the type of action (e.g., link_click, purchase, post_engagement, video_view, etc.)
    • value: the count of that action

    To reconstruct the "Result," you would need to filter to the action_type that matches the campaign objective. This requires joining through to campaign_history (via ad_history and ad_set_history) to get the objective, then mapping the objective to the corresponding action type. For example:

    • Campaign objective LINK_CLICKS or OUTCOME_TRAFFIC -> action_type = 'link_click'
    • Campaign objective OUTCOME_LEADS -> depends on your conversion event (e.g., offsite_conversion.fb_pixel_lead)

    This approach is more complex than Option 1 because the objective-to-action_type mapping is not always straightforward, particularly for conversion-based objectives where the specific action depends on how the campaign was configured. Similarly, the basic_all_levels_cost_per_action_type child table contains the equivalent of the "Cost per Result" metric, structured the same way.

    Understanding child tables in Fivetran

    If you are not familiar with Fivetran's child table concept, when a source API returns array or nested data within a record, Fivetran unpacks it into a separate "child" table with a foreign key relationship back to the parent table. This keeps your data normalized and queryable via standard SQL joins. The child tables follow the naming convention {parent_table}_{field_name}.

    For more details on the Facebook Ads connector schema, available prebuilt reports, and custom report configuration, please see the Fivetran Facebook Ads connector documentation: https://fivetran.com/docs/connectors/applications/facebook-ads

    I hope this helps you get the data you need. If you have any questions about the specific SQL joins or setting up a custom report, please do not hesitate to reach out.

    Cheers,
    Luke

    Hi Barbara, Luke from the Product team here!

    Can you elaborate on your request? Do you have an example from Meta's documentation of the "results" field you're looking for?

    My understanding is that the results you see in the UI depend on the type of campaign and the goal you set. So, "results" is a generalization of several fields like conversions, clicks, or impressions, which we support.

    Let me know if you have any questions or if I am missing something.

    Thanks,
    Luke 

    Hi,

    Late to the party here but here's the documentation:

    https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group/insights#fields

    results
    list<AdsInsightsResult>
    The number of times your ad achieved an outcome, based on the objective and settings you selected.