# Pinterest Ads schema ERD

Table and field reference for the Fivetran Pinterest Ads connector.

## Table & Field Reference

### pin_media

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| _fivetran_pin_id | String | PK, FK |
| cover_image_url | String |  |
| description | String |  |
| duration | Long |  |
| height | Int |  |
| item_type | String |  |
| link | String |  |
| title | String |  |
| width | Int |  |

### customer_list_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_time | Instant | PK |
| advertiser_id | String | FK |
| created_time | Instant |  |
| exceptions | String |  |
| name | String |  |
| num_batches | Long |  |
| num_removed_user_records | Long |  |
| num_uploaded_user_records | Long |  |
| status | String |  |

### product_group_report

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| ad_group_id | String | PK, FK |
| advertiser_id | String | PK, FK |
| campaign_id | String | PK, FK |
| product_group_id | String | PK, FK |

### pin_promotion_targeting_report

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| targeting_type | String | PK |
| targeting_value | String | PK |
| ad_group_id | String | PK, FK |
| advertiser_id | String | PK, FK |
| campaign_id | String | PK, FK |
| pin_promotion_id | String | PK, FK |

### product_item_report

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| product_item_id | String | PK |
| ad_group_id | String | PK, FK |
| advertiser_id | String | PK, FK |
| campaign_id | String | PK, FK |
| pin_id | String | PK, FK |

### conversion_tag_history

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| advertiser_id | String | FK |
| code_snippet | String |  |
| enhanced_match_status | String |  |
| id | String |  |
| last_fired_time_ms | String |  |
| name | String |  |
| status | String |  |
| version | String |  |

### targeting_app_type

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| name | String |  |

### pin_history

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| board_id | String | FK |
| board_section_id | String | FK |
| parent_pin_id | String | FK |
| ad_creative_type | String |  |
| alt_text | String |  |
| board_owner_username | String |  |
| created_at | Instant |  |
| description | String |  |
| dominant_color | String |  |
| id | String |  |
| is_standard | Boolean |  |
| link | String |  |
| media_type | String |  |
| title | String |  |

### mmm_ad_group_targeting_daily_report

| Column | Type | Keys |
| --- | --- | --- |
| app_type | String | PK |
| date | LocalDate | PK |
| gender | String | PK |
| location_code | String | PK |
| ad_group_id | String | PK, FK |
| advertiser_id | String | PK, FK |
| country | String |  |
| cpc | Double |  |
| creative_type | String |  |
| ctr | Double |  |
| earned_impressions | Int |  |
| earned_pin_clicks | Int |  |
| ecpm | Double |  |
| engagement_rate | Double |  |
| engagements | Int |  |
| impressions | Int |  |
| location | String |  |
| paid_impressions | Int |  |
| paid_pin_clicks | Int |  |
| pin_clicks | Int |  |
| spend | Double |  |
| spend_in_account_currency | Double |  |
| spend_order_line_id | String |  |
| spend_order_line_paid_type | String |  |

### targeting_gender

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| name | String |  |

### campaign_report

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| advertiser_id | String | PK, FK |
| campaign_id | String | PK, FK |

### product_group_history

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| ad_group_id | String | FK |
| catalog_product_group_id | String | FK |
| parent_id | String | FK |
| bid_in_micro_currency | Long |  |
| collections_hero_destination_url | String |  |
| collections_hero_pin_id | String |  |
| creative_type | String |  |
| definition | String |  |
| id | String |  |
| included | Boolean |  |
| is_mdl | Boolean |  |
| relative_definition | String |  |
| slideshow_collections_description | String |  |
| slideshow_collections_title | String |  |
| status | String |  |
| tracking_url | String |  |

### catalog_feed_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| created_at | Instant |  |
| default_availability | String |  |
| default_country | String |  |
| default_currency | String |  |
| default_locale | String |  |
| format | String |  |
| location | String |  |
| name | String |  |
| preferred_processing_schedule_time | String |  |
| preferred_processing_schedule_timezone | String |  |
| status | String |  |

### board_section

| Column | Type | Keys |
| --- | --- | --- |
| board_id | String | PK |
| id | String | PK |
| name | String |  |

### targeting_age_bucket

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| name | String |  |

### keyword_history

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| ad_group_id | String | FK |
| advertiser_id | String | FK |
| campaign_id | String | FK |
| archived | Boolean |  |
| bid | Long |  |
| id | String |  |
| match_type | String |  |
| parent_type | String |  |
| value | String |  |

### mmm_campaign_targeting_daily_report

| Column | Type | Keys |
| --- | --- | --- |
| app_type | String | PK |
| date | LocalDate | PK |
| gender | String | PK |
| location_code | String | PK |
| advertiser_id | String | PK, FK |
| campaign_id | String | PK, FK |
| country | String |  |
| cpc | Double |  |
| creative_type | String |  |
| ctr | Double |  |
| earned_impressions | Int |  |
| earned_pin_clicks | Int |  |
| ecpm | Double |  |
| engagement_rate | Double |  |
| engagements | Int |  |
| impressions | Int |  |
| location | String |  |
| paid_impressions | Int |  |
| paid_pin_clicks | Int |  |
| pin_clicks | Int |  |
| spend | Double |  |
| spend_in_account_currency | Double |  |
| spend_order_line_id | String |  |
| spend_order_line_paid_type | String |  |

### targeting_geo

| Column | Type | Keys |
| --- | --- | --- |
| country_id | String | PK |
| country_name | String |  |

### catalog_product_groups_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| last_update | Instant | PK |
| feed_profile_id | String | FK |
| created_at | Instant |  |
| description | String |  |
| filters | Json |  |
| is_featured | Boolean |  |
| name | String |  |
| status | String |  |
| type | String |  |

### keyword_report

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| keyword_id | String | PK |
| ad_group_id | String | PK, FK |
| advertiser_id | String | PK, FK |
| campaign_id | String | PK, FK |
| pin_id | String | PK, FK |
| pin_promotion_id | String | PK, FK |

### board_history

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| board_pins_modified_at | Instant |  |
| collaborator_count | Int |  |
| created_at | Instant |  |
| description | String |  |
| follower_count | Int |  |
| id | String |  |
| media_image_cover_url | String |  |
| name | String |  |
| owner_username | String |  |
| pin_count | Int |  |
| privacy | String |  |

### pin_media_image

| Column | Type | Keys |
| --- | --- | --- |
| property_name | String | PK |
| _fivetran_media_id | String | PK, FK |
| _fivetran_pin_id | String | PK, FK |
| height | Int |  |
| url | String |  |
| width | Int |  |

### targeting_geo_metro

| Column | Type | Keys |
| --- | --- | --- |
| metro_id | String | PK |
| country_id | String | FK |
| metro_name | String |  |

### pin_promotion_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_time | Instant | PK |
| ad_group_id | String | FK |
| campaign_id | String | FK |
| pin_id | String | FK |
| ad_account_id | String |  |
| android_deep_link | String |  |
| click_tracking_url | String |  |
| collection_items_destination_url_template | String |  |
| created_time | Instant |  |
| creative_type | String |  |
| destination_url | String |  |
| ios_deep_link | String |  |
| is_pin_deleted | Boolean |  |
| is_removable | Boolean |  |
| name | String |  |
| review_status | String |  |
| status | String |  |
| summary_status | String |  |
| view_tracking_url | String |  |

### board_pin_thumbnail_url

| Column | Type | Keys |
| --- | --- | --- |
| url | String | PK |
| board_id | String | PK, FK |

### rejected_reason_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| pin_promotion_id | String | PK, FK |
| updated_time | Instant | PK, FK |
| reason | String |  |

### ad_group_report

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| ad_group_id | String | PK, FK |
| advertiser_id | String | PK, FK |

### campaign_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_time | Instant | PK |
| advertiser_id | String | FK |
| created_time | Instant |  |
| daily_spend_cap | Long |  |
| default_ad_group_budget_in_micro_currency | Long |  |
| end_time | Instant |  |
| is_automated_campaign | Boolean |  |
| is_campaign_budget_optimization | Boolean |  |
| is_flexible_daily_budgets | Boolean |  |
| lifetime_spend_cap | Long |  |
| name | String |  |
| objective_type | String |  |
| order_line_id | String |  |
| start_time | Instant |  |
| status | String |  |
| summary_status | String |  |

### targeting_interest

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| level | Int |  |
| name | String |  |
| parent_id | String |  |

### targeting_geo_region

| Column | Type | Keys |
| --- | --- | --- |
| region_id | String | PK |
| country_id | String | FK |
| region_name | String |  |

### targeting_locale

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| name | String |  |

### pin_app_type_report

| Column | Type | Keys |
| --- | --- | --- |
| app_type | String | PK |
| date | Instant | PK |
| pin_id | String | PK, FK |
| advertiser_id | String | FK |

### ad_group_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_time | Instant | PK |
| ad_account_id | String | FK |
| campaign_id | String | FK |
| auto_targeting_enabled | Boolean |  |
| bid_in_micro_currency | Long |  |
| bid_strategy_type | String |  |
| billable_event | String |  |
| budget_in_micro_currency | Long |  |
| budget_type | String |  |
| conversion_learning_mode_type | String |  |
| created_time | Instant |  |
| end_time | Instant |  |
| feed_profile_id | String |  |
| lifetime_frequency_cap | Int |  |
| name | String |  |
| optimization_goal_metadata | Json |  |
| pacing_delivery_type | String |  |
| placement_group | String |  |
| start_time | Instant |  |
| status | String |  |
| summary_status | String |  |
| upgrade_status | String |  |

### targeting_location

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| name | String |  |

### ad_rejected_label_history

| Column | Type | Keys |
| --- | --- | --- |
| label | String | PK |
| pin_promotion_id | String | PK, FK |
| updated_time | Instant | PK, FK |

### advertiser_targeting_geo_report

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| geo_id | String | PK |
| targeting_type | String | PK |
| advertiser_id | String | PK, FK |
| country_id | String | PK, FK |
| location_id | String | PK, FK |
| region_id | String | PK, FK |
| clicks | Long |  |
| ecpm_in_micro_dollar | BigDecimal |  |
| engagement_1 | Long |  |
| impressions | Long |  |
| spend | BigDecimal |  |
| total_engagement | Long |  |

### advertiser_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_time | Instant | PK |
| account_permissions | Json |  |
| country | String |  |
| created_time | Instant |  |
| currency | String |  |
| name | String |  |
| owner_user_id | String |  |
| owner_username | String |  |

### audience_history

| Column | Type | Keys |
| --- | --- | --- |
| audience_type | String | PK |
| id | String | PK |
| updated_time | Instant | PK |
| advertiser_id | String | PK, FK |
| created_time | Instant |  |
| description | String |  |
| name | String |  |
| rule | Json |  |
| size | Int |  |
| status | String |  |

### product_group_targeting_report

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| targeting_type | String | PK |
| targeting_value | String | PK |
| advertiser_id | String | PK, FK |
| product_group_id | String | PK, FK |

### advertiser_report

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| advertiser_id | String | PK, FK |

### pin_promotion_report

| Column | Type | Keys |
| --- | --- | --- |
| date | Instant | PK |
| ad_group_id | String | PK, FK |
| advertiser_id | String | PK, FK |
| campaign_id | String | PK, FK |
| pin_promotion_id | String | PK, FK |

### conversion_tag_config

| Column | Type | Keys |
| --- | --- | --- |
| conversion_tag_fivetran_id | String | PK, FK |
| aem_db_enabled | Boolean |  |
| aem_enabled | Boolean |  |
| aem_fnln_enabled | Boolean |  |
| aem_ge_enabled | Boolean |  |
| aem_loc_enabled | Boolean |  |
| aem_ph_enabled | Boolean |  |
| md_frequency | Double |  |

## Relationships

- pin_media(_fivetran_pin_id) → pin_history(_fivetran_id)
- customer_list_history(advertiser_id) → advertiser_history(id)
- product_group_report(product_group_id) → product_group_history(_fivetran_id)
- product_group_report(advertiser_id) → advertiser_history(id)
- product_group_report(campaign_id) → campaign_history(id)
- product_group_report(ad_group_id) → ad_group_history(id)
- pin_promotion_targeting_report(pin_promotion_id) → pin_promotion_history(id)
- pin_promotion_targeting_report(advertiser_id) → advertiser_history(id)
- pin_promotion_targeting_report(campaign_id) → campaign_history(id)
- pin_promotion_targeting_report(ad_group_id) → ad_group_history(id)
- product_item_report(advertiser_id) → advertiser_history(id)
- product_item_report(campaign_id) → campaign_history(id)
- product_item_report(ad_group_id) → ad_group_history(id)
- product_item_report(pin_id) → pin_history(_fivetran_id)
- conversion_tag_history(advertiser_id) → advertiser_history(id)
- pin_history(board_id) → board_history(_fivetran_id)
- pin_history(board_section_id) → board_section(id)
- pin_history(parent_pin_id) → pin_history(_fivetran_id)
- mmm_ad_group_targeting_daily_report(advertiser_id) → advertiser_history(id)
- mmm_ad_group_targeting_daily_report(ad_group_id) → ad_group_history(id)
- campaign_report(campaign_id) → campaign_history(id)
- campaign_report(advertiser_id) → advertiser_history(id)
- product_group_history(ad_group_id) → ad_group_history(id)
- product_group_history(parent_id) → product_group_history(_fivetran_id)
- product_group_history(catalog_product_group_id) → catalog_product_groups_history(id)
- keyword_history(advertiser_id) → advertiser_history(id)
- keyword_history(campaign_id) → campaign_history(id)
- keyword_history(ad_group_id) → ad_group_history(id)
- mmm_campaign_targeting_daily_report(advertiser_id) → advertiser_history(id)
- mmm_campaign_targeting_daily_report(campaign_id) → campaign_history(id)
- catalog_product_groups_history(feed_profile_id) → catalog_feed_history(id)
- keyword_report(campaign_id) → campaign_history(id)
- keyword_report(advertiser_id) → advertiser_history(id)
- keyword_report(ad_group_id) → ad_group_history(id)
- keyword_report(pin_promotion_id) → pin_promotion_history(id)
- keyword_report(pin_id) → pin_history(_fivetran_id)
- pin_media_image(_fivetran_pin_id) → pin_history(_fivetran_id)
- pin_media_image(_fivetran_media_id) → pin_media(_fivetran_pin_id)
- targeting_geo_metro(country_id) → targeting_geo(country_id)
- pin_promotion_history(ad_group_id) → ad_group_history(id)
- pin_promotion_history(campaign_id) → campaign_history(id)
- pin_promotion_history(pin_id) → pin_history(_fivetran_id)
- board_pin_thumbnail_url(board_id) → board_history(_fivetran_id)
- rejected_reason_history(pin_promotion_id) → pin_promotion_history(id)
- rejected_reason_history(updated_time) → pin_promotion_history(id)
- ad_group_report(ad_group_id) → ad_group_history(id)
- ad_group_report(advertiser_id) → advertiser_history(id)
- campaign_history(advertiser_id) → advertiser_history(id)
- targeting_geo_region(country_id) → targeting_geo(country_id)
- pin_app_type_report(pin_id) → pin_history(_fivetran_id)
- pin_app_type_report(advertiser_id) → advertiser_history(id)
- ad_group_history(campaign_id) → campaign_history(id)
- ad_group_history(ad_account_id) → advertiser_history(id)
- ad_rejected_label_history(pin_promotion_id) → pin_promotion_history(id)
- ad_rejected_label_history(updated_time) → pin_promotion_history(id)
- advertiser_targeting_geo_report(advertiser_id) → advertiser_history(id)
- advertiser_targeting_geo_report(country_id) → targeting_geo(country_id)
- advertiser_targeting_geo_report(region_id) → targeting_geo_region(region_id)
- advertiser_targeting_geo_report(location_id) → targeting_location(id)
- audience_history(advertiser_id) → advertiser_history(id)
- product_group_targeting_report(product_group_id) → product_group_history(_fivetran_id)
- product_group_targeting_report(advertiser_id) → advertiser_history(id)
- advertiser_report(advertiser_id) → advertiser_history(id)
- pin_promotion_report(pin_promotion_id) → pin_promotion_history(id)
- pin_promotion_report(advertiser_id) → advertiser_history(id)
- pin_promotion_report(campaign_id) → campaign_history(id)
- pin_promotion_report(ad_group_id) → ad_group_history(id)
- conversion_tag_config(conversion_tag_fivetran_id) → conversion_tag_history(_fivetran_id)
