Facebook Ads

Guide to integrate your Facebooks Ads data to Sprinkle

Datasource Concepts

Before setting up the datasource, learn about datasource concepts here

Pre-requisite

To fetch data from Facebook Ads, Sprinkle requires following permissions:

  • ads_management

  • ads_read

  • business_management

Check Generating Facebook Access Token

Step by Step Guide

STEP-1: Configure Connection

To learn about Connection, refer here

  • Log into Sprinkle application

  • Navigate to Datasources -> Connections Tab -> New Connection ->

  • Select Facebook Ads

  • Provide all the mandatory details

    • Name: Name to identify this connection

    • Access Key: This Extended Access Token expires after 60 days. Provide new Extended Access Token after 60 days. Check Generate Access Token

    • Advance Settings: Refer here

  • Test Connection

  • Create

STEP-2: Configure Datasource

To learn about datasource, refer here

  • Navigate to Datasources -> Datasources Tab -> Add ->

  • Select Facebook Ads

  • Provide the name -> Create

  • Connection Tab:

    • From the drop-down, select the name of connection created in STEP-2

    • Update

STEP-3: Create Dataset

Datasets Tab: To learn about Dataset, refer here. Add Dataset for each report/dataset that you want to integrate, providing following details

  • Report Type (Required)

    • ADACCOUNTS, ADSETS, CAMPAIGNS

    • AD_INSIGHTS, ADACCOUNTS_INSIGHTS, CAMPAIGNS_INSIGHTS, ADSETS_INSIGHTS

      • Fields (Required): Data fields to fetch. Refer Facebook Docs

      • Breakdowns (Optional) : Select compatible values from dropdown. Read more from facebook docs

      • Start Date (Required) : Format:YYYY-MM-DD. Data will be fetched from start date, for every run

      • Window for Backfill (Required) : Mention window for backfill, for backfilling metrics in every run to include updates from attribution window. Can take values 1, 7 and 28. Read more from facebook docs

      • Time Increment (Optional) :

      • Filtering (Optional) : Filtering can be applied on the resulted data. To apply filter give value like:- {"field":"ad.adlabels","operator":"ANY", "value":["Label Name"]}. For multiple filtering, give the json as comma separated. For ex:- {"field":"ad.adlabels","operator":"ANY","value":["Label Name"]} , {"field":"ad.adlabels","operator":"ANY","value":["Label Name"]}.You can read more about filtering from docs

      • Attribution windows (Optional) : Select from 1d_click, 7d_click, 28d_click, 1d_view, 7d_view, 28d_view

  • Ad Accounts (Required) : If all is selected, sprinkle will ingest data from all add accounts, Select multi for ingesting data from specific add accounts.

    • All

    • Multi-select

  • Flatten Level(Required) : Select One Level or Multi Level. In one level, flattening will not be applied on complex type. They will be stored as string. In multi level, flattening will be applied in complex level till they become simple type.

  • Destination Schema (Required) : Data warehouse schema where the table will be ingested into

  • Destination Table name (Required) : It is the table name to be created on the warehouse. If not given, sprinkle will create like ds_<datasourcename>_<tablename>

  • Destination Create Table Clause: Provide additional clauses to warehouse-create table queries such as clustering, partitioning, and more, useful for optimizing DML statements. Learn more on how to use this field.

  • Create

STEP-4: Run and schedule Ingestion

In the Ingestion Jobs tab:

  • Trigger the Job, using Run button

  • To schedule, enable Auto-Run. Change the frequency if needed

Generate Facebook Access Token

In your Facebook developer console, click on β€œTools” and β€œGraph API Explorer” to generate Extended Access token. In the Permissions section give ads_read and ads_management permissions and click on Generate Access Token.

To generate an Extended Access Token which lasts 60 Days, users have to click on the i icon present in the Access Token field. By clicking on the Open in Access Token Tool, user will be redirected to the page, which provides the user the access token.

‍

By clicking on the Extend Access Token, users just have to fill the password linked to their Facebook account and Extended Access Token will be generated, which can be used in Sprinkle to run ingestion. ‍

Advanced Connection Settings

  • API Read Timeout (In seconds) : Maximum time of inactivity between two data packets when waiting for the server's response. The default value is 30 seconds

  • API Connection Timeout (In seconds) : Time period within which a connection between a client and a server must be established.

  • Retry Limit : Number of retries allowed when an API call fails. For example if an API call fails and retry.limit is 5 then it will check 5 times for that API call and if it succeeded then it will stop checking.

  • Retry Sleep Time (In milliseconds) : Given time, after which retry should happen in case an API call fails.

  • Incremental Batch Size (In days) : No of days in one batch for which data is being downloaded during incremental ingestion.

  • Facebook Version : it gives information about the version of API used.

Dataset Fields

ADACCOUNTS
  • account_id

  • id

  • account_status

  • age

  • agency_client_declaration

  • amount_spent

  • balance

  • business_city

  • business_country_code

  • business_name

  • business_state

  • business_street

  • business_street2

  • business_zip

  • currency

  • end_advertiser

  • funding_source

  • funding_source_details

  • is_personal

  • media_agency

  • name

  • offsite_pixels_tos_accepted

  • owner

  • partner

  • spend_cap

  • tax_id

  • tax_id_status

  • timezone_id

  • timezone_name

  • timezone_offset_hours_utc

  • tos_accepted

ADSETS
  • account_id

  • id

  • name

  • bid_info

  • adlabels

  • status

  • adset_schedule

  • bid_strategy

  • bid_amount

  • billing_event

  • budget_remaining

  • campaign

  • campaign_id

  • configured_status

  • created_time

  • creative_sequence

  • daily_budget

  • effective_status

  • end_time

  • lifetime_budget

  • lifetime_imps

  • use_new_app_click

  • optimization_goal

  • pacing_type

  • promoted_object

  • destination_type

  • rf_prediction_id

  • start_time

  • targeting

  • updated_time

  • optimization_sub_event

CAMPAIGNS
  • account_id

  • id

  • name

  • adlabels

  • buying_type

  • daily_budget

  • status

  • topline_id

  • source_campaign

  • source_campaign_id

  • special_ad_categories

  • configured_status

  • effective_status

  • objective

  • promoted_object

  • spend_cap

  • start_time

  • stop_time

  • updated_time

  • lifetime_budget

  • budget_remaining

  • pacing_type

AD_INSIGHTS, ADACCOUNTS_INSIGHTS, CAMPAIGNS_INSIGHTS, ADSETS_INSIGHTS
  • account_currency

  • account_id

  • account_name

  • ad_id

  • ad_name

  • aset_id

  • adset_name

  • campaign_id

  • campaign_group_name

  • adgroup_name

  • campaign_name

  • action_values

  • activity_recency

  • ad_click_actions

  • ad_format_asset

  • ad_impression_actions

  • cpc

  • age_targeting

  • attribution_setting

  • auction_bid

  • auction_competitiveness

  • auction_max_competitor_bid

  • body_asset

  • buying_type

  • canvas_avg_view_percent

  • canavs_avg_view_time

  • catalog_segment_actions

  • catalog_segment_value

  • catalog_segment_value_mobile_purchase_roas

  • catalog_segment_value_omni_purchase_roas

  • catalog_segment_value_website_purchase_roas

  • comparision_node

  • conversions

  • converted_product_quantity

  • converted_product_value

  • cpm

  • cpp

  • created_time

  • updated_time

  • ctr

  • clicks

  • impressions

  • actions

  • unique_actions

  • spend

  • social_spend

  • frequency

  • frequency_value

  • reach

  • labels

  • location

  • website_ctr

  • conversion_rate_ranking

  • conversion_values

  • unique_ctr

  • inline_link_clicks

  • unique_inline_link_clicks

  • inline_link_clicks_ctr

  • unique_inline_link_clicks_ctr

  • unique_link_clicks_ctr

  • country

  • date_start

  • date_stop

  • dda_countby_convs

  • dda_results

  • cost_per_15_sec_video_view

  • cost_per_2_sec_continuous_video_view

  • cost_per_action_type

  • cost_per_ad_click

  • cost_per_conversion

  • cost_per_dda_countby_convs

  • cost_per_inline_link_click

  • description_asset

  • device_platform

  • dma

  • estimated_ad_recall_rate_lower_bound

  • cost_per_inline_post_engagement

  • cost_per_one_thousand_ad_impression

  • cost_per_outbound_click

  • cost_per_store_visit_action

  • cost_per_thruplay

  • cost_per_unique_action_type

  • cost_per_unique_click

  • estimated_ad_recall_rate_upper_bound

  • estimated_ad_recallers_lower_bound

  • estimated_ad_recallers_upper_bound

  • cost_per_unique_conversion

  • cost_per_unique_inline_link_click

  • cost_per_unique_outbound_click

  • full_view_impressions

  • full_view_reach

  • gender_targeting

  • hourly_stats_aggregated_by_advertiser_time_zone

  • hourly_stats_aggregated_by_audience_time_zone

  • image_asset

  • impression_device

  • impression_dummy

  • inline_post_engagement

  • instant_experience_clicks_to_open

  • instant_experience_clicks_to_start

  • instant_experience_outbound_clicks

  • media_asset

  • mobile_app_purchase_roas

  • objective

  • optimization_goal

  • outbound_clicks

  • outbound_clicks_ctr

  • interactive_component_tap

  • place_page_id

  • place_page_name

  • platform_position

  • product_id

  • publisher_platform

  • purchase_roas

  • qualifying_question_qualify_answer_rate

  • rule_asset

  • title_asset

  • video_15_sec_watched_actions

  • video_30_sec_watched_actions

  • video_asset video_avg_time_watched_actions

  • video_continuous_2_sec_watched_actions

  • video_p100_watched_actions

  • video_p25_watched_actions

  • video_p50_watched_actions

  • video_p75_watched_actions

  • video_p95_watched_actions

  • video_play_actions

  • video_play_curve_actions

  • video_play_retention_0_to_15s_actions

  • video_play_retention_20_to_60s_actions

  • video_play_retention_graph_actions

  • video_time_watched_actions

  • website_purchase_raos

  • wish_bid

  • link_click

  • app_install

  • app_use

  • mobile_app_install

  • search

  • offsite_conversion_fb_pixel_search

  • onsite_app_view_content

  • video_view

  • comment

  • offsite_conversion_search

  • app_custom_event_fb_mobile_purchase

  • app_custom_event_other

  • app_custom_event_fb_mobile_complete_registration

  • app_custom_event_fb_mobile_rate

  • app_custom_event_fb_mobile_content_view

  • app_custom_event_fb_mobile_spent_credits

  • post

  • post_reaction

  • app_custom_event_fb_mobile_achievement_unlocked

  • offsite_conversion_fb_pixel_custom

  • onsite_web_purchase

  • app_custom_event_fb_mobile_add_payment_info

  • app_custom_event_fb_mobile_activate_app

  • omni_app_install

  • omni_purchase

  • omni_view_content

  • omni_search

  • omni_activate_app

  • omni_tutorial_completion

  • omni_spend_credits

  • omni_rate

  • omni_level_achieved

  • like

  • credit_spent

  • offline_conversion_view_content

  • onsite_web_view_content

  • unique_link_click

  • unique_app_install

  • unique_app_use

  • unique_mobile_app_install

  • unique_search

  • unique_offsite_conversions_fb_pixel_search

  • unique_onsite_app_view_content

  • unique_video_view

  • unique_comment

  • unique_offsite_conversion_search

  • unique_app_custom_event_fb_mobile_purchase

  • unique_app_custom_event_other

  • unique_app_custom_event_fb_mobile_complete_registration

  • unique_app_custom_event_fb_mobile_search

  • unique_app_custom_event_fb_mobile_rate

  • unique_app_custom_event_fb_mobile_content_view

  • unique_app_custom_event_fb_mobile_spent_credits

  • unique_post

  • unique_post_reaction

  • unique_app_custom_event_fb_mobile__acheivement_unlocked

  • unique_offsite_conversion_fb_pixel_custom

  • unique_onsite_web_purchase

  • unique_app_custom_event_fb_mobile_add_payment_info

  • unique_app_custom_event_fb_mobile_activate_app

  • unique_omni_app_install

  • unique_omni_purchase

  • unique_omni_view_content

  • unique_omni_search

  • unique_omni_activate_app

  • unique_omni_tutorial_completion

  • unique_omni_spend_credits

  • unique_omni_rate

  • unique_omni_level_achieved

  • unique_like

  • unique_credit_spent

  • unique_offline_conversion_view_content

  • unique_onsite_web_view_content

  • account_currency

  • account_id

  • account_name

  • ad_id

  • ad_name

  • aset_id

  • adset_name

  • campaign_id

  • campaign_group_name

  • adgroup_name

  • campaign_name

  • action_values

  • activity_recency

  • ad_click_actions

  • ad_format_asset

  • ad_impression_actions

  • cpc

  • age_targeting

  • attribution_setting

  • auction_bid

  • auction_competitiveness

  • auction_max_competitor_bid

  • body_asset

  • buying_type

  • canvas_avg_view_percent

  • canavs_avg_view_time

  • catalog_segment_actions

  • catalog_segment_value

  • catalog_segment_value_mobile_purchase_roas

  • catalog_segment_value_omni_purchase_roas

  • catalog_segment_value_website_purchase_roas

  • comparision_node

  • conversions

  • converted_product_quantity

  • converted_product_value

  • cpm

  • cpp

  • created_time

  • updated_time

  • ctr

  • clicks

  • impressions

  • actions

  • unique_actions

  • spend

  • social_spend

  • frequency

  • frequency_value

  • reach

  • labels

  • location

  • website_ctr

  • conversion_rate_ranking

  • conversion_values

  • unique_ctr

  • inline_link_clicks

  • unique_inline_link_clicks

  • inline_link_clicks_ctr

  • unique_inline_link_clicks_ctr

  • unique_link_clicks_ctr

  • country

  • date_start

  • date_stop

  • dda_countby_convs

  • dda_results

  • cost_per_15_sec_video_view

  • cost_per_2_sec_continuous_video_view

  • cost_per_action_type

  • cost_per_ad_click

  • cost_per_conversion

  • cost_per_dda_countby_convs

  • cost_per_inline_link_click

  • description_asset

  • device_platform

  • dma

  • estimated_ad_recall_rate_lower_bound

  • cost_per_inline_post_engagement

  • cost_per_one_thousand_ad_impression

  • cost_per_outbound_click

  • cost_per_store_visit_action

  • cost_per_thruplay

  • cost_per_unique_action_type

  • cost_per_unique_click

  • estimated_ad_recall_rate_upper_bound

  • estimated_ad_recallers_lower_bound

  • estimated_ad_recallers_upper_bound

  • cost_per_unique_conversion

  • cost_per_unique_inline_link_click

  • cost_per_unique_outbound_click

  • full_view_impressions

  • full_view_reach

  • gender_targeting

  • hourly_stats_aggregated_by_advertiser_time_zone

  • hourly_stats_aggregated_by_audience_time_zone

  • image_asset

  • impression_device

  • impression_dummy

  • inline_post_engagement

  • instant_experience_clicks_to_open

  • instant_experience_clicks_to_start

  • instant_experience_outbound_clicks

  • media_asset

  • mobile_app_purchase_roas

  • objective

  • optimization_goal

  • outbound_clicks

  • outbound_clicks_ctr

  • interactive_component_tap

  • place_page_id

  • place_page_name

  • platform_position

  • product_id

  • publisher_platform

  • purchase_roas

  • qualifying_question_qualify_answer_rate

  • rule_asset

  • title_asset

  • video_15_sec_watched_actions

  • video_30_sec_watched_actions

  • video_asset video_avg_time_watched_actions

  • video_continuous_2_sec_watched_actions

  • video_p100_watched_actions

  • video_p25_watched_actions

  • video_p50_watched_actions

  • video_p75_watched_actions

  • video_p95_watched_actions

  • video_play_actions

  • video_play_curve_actions

  • video_play_retention_0_to_15s_actions

  • video_play_retention_20_to_60s_actions

  • video_play_retention_graph_actions

  • video_time_watched_actions

  • website_purchase_raos

  • wish_bid

  • link_click

  • app_install

  • app_use

  • mobile_app_install

  • search

  • offsite_conversion_fb_pixel_search

  • onsite_app_view_content

  • video_view

  • comment

  • offsite_conversion_search

  • app_custom_event_fb_mobile_purchase

  • app_custom_event_other

  • app_custom_event_fb_mobile_complete_registration

  • app_custom_event_fb_mobile_rate

  • app_custom_event_fb_mobile_content_view

  • app_custom_event_fb_mobile_spent_credits

  • post

  • post_reaction

  • app_custom_event_fb_mobile_achievement_unlocked

  • offsite_conversion_fb_pixel_custom

  • onsite_web_purchase

  • app_custom_event_fb_mobile_add_payment_info

  • app_custom_event_fb_mobile_activate_app

  • omni_app_install

  • omni_purchase

  • omni_view_content

  • omni_search

  • omni_activate_app

  • omni_tutorial_completion

  • omni_spend_credits

  • omni_rate

  • omni_level_achieved

  • like

  • credit_spent

  • offline_conversion_view_content

  • onsite_web_view_content

  • unique_link_click

  • unique_app_install

  • unique_app_use

  • unique_mobile_app_install

  • unique_search

  • unique_offsite_conversions_fb_pixel_search

  • unique_onsite_app_view_content

  • unique_video_view

  • unique_comment

  • unique_offsite_conversion_search

  • unique_app_custom_event_fb_mobile_purchase

  • unique_app_custom_event_other

  • unique_app_custom_event_fb_mobile_complete_registration

  • unique_app_custom_event_fb_mobile_search

  • unique_app_custom_event_fb_mobile_rate

  • unique_app_custom_event_fb_mobile_content_view

  • unique_app_custom_event_fb_mobile_spent_credits

  • unique_post

  • unique_post_reaction

  • unique_app_custom_event_fb_mobile__acheivement_unlocked

  • unique_offsite_conversion_fb_pixel_custom

  • unique_onsite_web_purchase

  • unique_app_custom_event_fb_mobile_add_payment_info

  • unique_app_custom_event_fb_mobile_activate_app

  • unique_omni_app_install

  • unique_omni_purchase

  • unique_omni_view_content

  • unique_omni_search

  • unique_omni_activate_app

  • unique_omni_tutorial_completion

  • unique_omni_spend_credits

  • unique_omni_rate

  • unique_omni_level_achieved

  • unique_like

  • unique_credit_spent

  • unique_offline_conversion_view_content

  • unique_onsite_web_view_content

Last updated