Skip to main content

Description

The Platform Performance - Facebook dataset contains Facebook ad platform performance metrics and conversion reporting at the hourly, ad-level granularity.

Partition Keys

  • identifier
  • date
๐Ÿ’ก Note: Leverage partition keys when querying the table to improve query efficiency.

Primary Key

The concatenation of the following fields can be used as a primary key:
  • identifier
  • date
  • utc_hour
  • ad_id

Field Reference

OrderNameDescriptionType
1advertiserRockerbox Account IDstr
2typeReport type (e.g., platform_data, attribution)str
3platformName of platform (e.g., Facebook)str
4reportThe name of the report (only visible in Snowflake integrations)str
5identifierAd platform account identifierstr
6dateDate when the platform metrics occurreddate
7utc_hourUTC hour when the platform metrics occurredint
8tier_1Five-level categorization tiers aligned to UI taxonomy (most broad)str
9tier_2Five-level categorization tiers aligned to UI taxonomystr
10tier_3Five-level categorization tiers aligned to UI taxonomystr
11tier_4Five-level categorization tiers aligned to UI taxonomystr
12tier_5Five-level categorization tiers aligned to UI taxonomy (most granular)str
13mta_tiers_join_keyPlatform spend identifier (usually Ad ID or composite key)str
14campaign_nameThe name of the ad campaign. A campaign contains ad sets and adsstr
15campaign_idThe unique ID of the ad campaignstr
16adset_nameThe name of the ad setstr
17adset_idThe unique ID of the ad setstr
18ad_nameThe name of the adstr
19ad_idThe unique ID of the adstr
20spendThe estimated total amount spent in the ad platform accountโ€™s local currencyfloat
21currency_codeReporting currency for revenue and spendstr
22spend_usdThe estimated total amount spent in USDfloat
23clicksThe number of clicks on the adint
24impressionsThe number of times the ads were shown on screenint
25inline_link_clicksThe number of clicks on links to select destinations or experiences, on or off Facebook-owned properties (fixed 1-day-click attribution window)int
26outbound_clicksThe number of clicks on links that take users off Facebook-owned propertiesint
27view_1dThe total number of view-through conversions within a 1-day lookback windowdict
28click_1dThe total number of click-through conversions within a 1-day lookback windowdict
29click_7dThe total number of click-through conversions within a 7-day lookback windowdict
30view_1d_valueThe total value of view-through conversions (local currency) within a 1-day lookback windowdict
31click_1d_valueThe total value of click-through conversions (local currency) within a 1-day lookback windowdict
32click_7d_valueThe total value of click-through conversions (local currency) within a 7-day lookback windowdict
33view_1d_value_usdThe total value of view-through conversions converted to USD within a 1-day lookback windowdict
34click_1d_value_usdThe total value of click-through conversions converted to USD within a 1-day lookback windowdict
35click_7d_value_usdThe total value of click-through conversions converted to USD within a 7-day lookback windowdict
36rb_sync_idRockerbox internal sync identifierstr
37updated_atTimestamp when the record was last updatedtimestamp

Nested Fields

The following fields are nested JSON objects keyed by Facebook conversion event name:
  • view_1d
  • click_1d
  • click_7d
  • view_1d_value
  • click_1d_value
  • click_7d_value
  • view_1d_value_usd
  • click_1d_value_usd
  • click_7d_value_usd

Example Stored Object

{
  "purchase": 12,
  "add_to_cart": 41
}

Snowflake - Querying Nested Fields

Extract a Single Event

select
  date,
  ad_id,
  click_1d:"purchase"::number as purchase_click_1d,
  click_1d_value:"purchase"::float as purchase_value_click_1d
from <database>.<schema>.<table_name>;

Flatten All Events Into Rows

select
  t.date,
  t.ad_id,
  f.key as conversion_event,
  f.value::number as conversions_click_1d
from <database>.<schema>.<table_name> t,
  lateral flatten(input => t.click_1d) f;

Redshift - Querying Nested Fields (SUPER type)

Extract a Single Event

select
  date,
  ad_id,
  click_1d['purchase']::int as purchase_click_1d,
  click_1d_value['purchase']::decimal(18,4) as purchase_value_click_1d
from <database>.<schema>.<table_name>;

Flatten All Events Into Rows

select
select
  t.date,
  t.ad_id,
  kv.key as conversion_event,
  kv.value::int as conversions_click_1d
from <database>.<schema>.<table_name> t,
  t.click_1d as kv;

BigQuery - Querying Nested Fields (JSON type)

Extract a Single Event

select
  date,
  ad_id,
  cast(json_value(click_1d, '$.purchase') as int64) as purchase_click_1d,
  cast(json_value(click_1d_value, '$.purchase') as float64) as purchase_value_click_1d
from <project_id>.<dataset>.<table_name>;

Flatten All Events Into Rows

select
  t.date,
  t.ad_id,
  k as conversion_event,
  cast(json_value(t.click_1d, concat('$.', k)) as int64) as conversions_click_1d
from <project_id>.<dataset>.<table_name> t,
unnest(json_keys(t.click_1d)) as k;