# Snapchat Ads schema ERD

Table and field reference for the Fivetran Snapchat Ads connector.

## Table & Field Reference

### funding_source_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| organization_id | String | FK |
| available_credit_micro | Long |  |
| budget_spent_micro | Long |  |
| card_type | String |  |
| created_at | Instant |  |
| currency | String |  |
| daily_spend_limit_currency | String |  |
| daily_spend_limit_micro | Long |  |
| email | String |  |
| end_date | LocalDate |  |
| expiration_month | Short |  |
| expiration_year | Short |  |
| last_4_digits_of_card | Short |  |
| name | String |  |
| start_date | LocalDate |  |
| status | String |  |
| total_budget_micro | Long |  |
| type | String |  |
| value_micro | Long |  |

### ad_squad_segment_history

| Column | Type | Keys |
| --- | --- | --- |
| ad_squad_id | String | PK, FK |
| ad_squad_updated_at | Instant | PK, FK |
| audience_segment_id | String | PK, FK |
| operation | String |  |

### campaign_delivery_status

| Column | Type | Keys |
| --- | --- | --- |
| status | String | PK |
| campaign_id | String | PK, FK |
| campaign_updated_at | Instant | PK, FK |

### ad_squad_placement_v_2_snapchat_position

| Column | Type | Keys |
| --- | --- | --- |
| snapchat_position | String | PK |
| ad_squad_id | String | PK, FK |
| ad_squad_updated_at | Instant | PK, FK |

### ad_delivery_status

| Column | Type | Keys |
| --- | --- | --- |
| status | String | PK |
| ad_id | String | PK, FK |
| ad_updated_at | Instant | PK, FK |

### targeting_interest_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| ad_squad_id | String | PK, FK |
| ad_squad_updated_at | Instant | PK, FK |
| category_id | Json |  |

### targeting_demographic_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| ad_squad_id | String | PK, FK |
| ad_squad_updated_at | Instant | PK, FK |
| advanced_demographics | Json |  |
| age_groups | Json |  |
| gender | String |  |
| languages | Json |  |
| min_age | String |  |
| operation | String |  |

### targeting_device_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| ad_squad_id | String | PK, FK |
| ad_squad_updated_at | Instant | PK, FK |
| connection_type | String |  |
| os_type | String |  |

### ad_account_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| organization_id | String | FK |
| advertiser | String |  |
| agency_representing_client | Boolean |  |
| billing_type | String |  |
| client_paying_invoices | Boolean |  |
| created_at | Instant |  |
| currency | String |  |
| lifetime_spend_cap_micro | Long |  |
| name | String |  |
| regulations_restricted_delivery_signals | Boolean |  |
| status | String |  |
| timezone | String |  |
| type | String |  |
| agency_client_metadata_** |  |  |

### campaign_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| ad_account_id | String | FK |
| buy_model | String |  |
| created_at | Instant |  |
| daily_budget_micro | Long |  |
| end_time | Instant |  |
| lifetime_spend_cap_micro | Long |  |
| name | String |  |
| objective | String |  |
| objective_v_2_type | String |  |
| promotion_type | String |  |
| start_time | Instant |  |
| status | String |  |

### organization_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| address_line_1 | String |  |
| administrative_district_level_1 | String |  |
| country | String |  |
| created_at | Instant |  |
| locality | String |  |
| name | String |  |
| postal_code | String |  |
| type | String |  |

### ad_squad_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| campaign_id | String | FK |
| audience_size_maximum | Long |  |
| audience_size_minimum | Long |  |
| auto_bid | Boolean |  |
| bid_estimate_maximum | Long |  |
| bid_estimate_minimum | Long |  |
| bid_micro | Long |  |
| bid_strategy | String |  |
| billing_event | String |  |
| created_at | Instant |  |
| daily_budget_micro | Long |  |
| delivery_constraint | String |  |
| end_time | Instant |  |
| event_sources | Json |  |
| lifetime_budget_micro | Long |  |
| lifetime_spend_micro | Long |  |
| name | String |  |
| optimization_goal | String |  |
| pacing_type | String |  |
| placement | String |  |
| placement_v_2_config | String |  |
| start_time | Instant |  |
| status | String |  |
| target_bid | Boolean |  |
| targeting_regulated_content | Boolean |  |
| type | String |  |

### media_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| ad_account_id | String | FK |
| created_at | Instant |  |
| download_link | String |  |
| file_name | String |  |
| media_status | String |  |
| name | String |  |
| type | String |  |

### snap_pixel_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| ad_account_id | String | FK |
| created_at | Instant |  |
| effective_status | String |  |
| name | String |  |
| pixel_javascript | String |  |
| status | String |  |

### creative_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| ad_account_id | String | FK |
| app_install_icon_media_id | String | FK |
| deep_link_icon_media_id | String | FK |
| longform_video_media_id | String | FK |
| top_snap_media_id | String | FK |
| ad_product | String |  |
| app_install_android_app_url | String |  |
| app_install_app_name | String |  |
| app_install_ios_app_id | String |  |
| attachment_type | String |  |
| brand_name | String |  |
| call_to_action | String |  |
| created_at | Instant |  |
| deep_link_android_app_url | String |  |
| deep_link_app_name | String |  |
| deep_link_ios_app_id | String |  |
| deep_link_uri | String |  |
| headline | String |  |
| name | String |  |
| packaging_status | String |  |
| playback_type | String |  |
| preview_creative_id | String |  |
| review_status | String |  |
| shareable | Boolean |  |
| top_snap_crop_position | String |  |
| type | String |  |
| url_macro_parameters | String |  |
| web_view_** |  |  |

### ad_account_funding_source

| Column | Type | Keys |
| --- | --- | --- |
| ad_account_id | String | PK, FK |
| funding_source_id | String | PK, FK |

### ad_squad_delivery_status

| Column | Type | Keys |
| --- | --- | --- |
| status | String | PK |
| ad_squad_id | String | PK, FK |
| ad_squad_updated_at | Instant | PK, FK |

### targeting_geolocation_history

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| ad_squad_id | String | FK |
| ad_squad_updated_at | Instant | FK |
| country_code | String |  |
| geo_type | String |  |
| geo_value | String |  |
| operation | String |  |

### ad_squad_placement_v_2_platform

| Column | Type | Keys |
| --- | --- | --- |
| platform | String | PK |
| ad_squad_id | String | PK, FK |
| ad_squad_updated_at | Instant | PK, FK |

### audience_segment_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| ad_account_id | String | FK |
| approximate_number_users | Long |  |
| created_at | Instant |  |
| description | String |  |
| name | String |  |
| retention_in_days | Int |  |
| source_type | String |  |
| status | String |  |
| targetable_status | String |  |
| upload_status | String |  |

### creative_url_tag_history

| Column | Type | Keys |
| --- | --- | --- |
| key | String | PK |
| value | String | PK |
| creative_id | String | PK, FK |
| updated_at | Instant | PK, FK |

### ad_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| updated_at | Instant | PK |
| ad_squad_id | String | FK |
| creative_id | String | FK |
| created_at | Instant |  |
| deleted | Boolean |  |
| name | String |  |
| render_type | String |  |
| review_status | String |  |
| review_status_reason | String |  |
| status | String |  |
| type | String |  |

## Relationships

- funding_source_history(organization_id) → organization_history(id)
- ad_squad_segment_history(ad_squad_id) → ad_squad_history(id)
- ad_squad_segment_history(ad_squad_updated_at) → ad_squad_history(id)
- ad_squad_segment_history(audience_segment_id) → audience_segment_history(id)
- campaign_delivery_status(campaign_id) → campaign_history(id)
- campaign_delivery_status(campaign_updated_at) → campaign_history(id)
- ad_squad_placement_v_2_snapchat_position(ad_squad_id) → ad_squad_history(id)
- ad_squad_placement_v_2_snapchat_position(ad_squad_updated_at) → ad_squad_history(id)
- ad_delivery_status(ad_id) → ad_history(id)
- ad_delivery_status(ad_updated_at) → ad_history(id)
- targeting_interest_history(ad_squad_id) → ad_squad_history(id)
- targeting_interest_history(ad_squad_updated_at) → ad_squad_history(id)
- targeting_demographic_history(ad_squad_id) → ad_squad_history(id)
- targeting_demographic_history(ad_squad_updated_at) → ad_squad_history(id)
- targeting_device_history(ad_squad_id) → ad_squad_history(id)
- targeting_device_history(ad_squad_updated_at) → ad_squad_history(id)
- ad_account_history(organization_id) → organization_history(id)
- campaign_history(ad_account_id) → ad_account_history(id)
- ad_squad_history(campaign_id) → campaign_history(id)
- media_history(ad_account_id) → ad_account_history(id)
- snap_pixel_history(ad_account_id) → ad_account_history(id)
- creative_history(ad_account_id) → ad_account_history(id)
- creative_history(top_snap_media_id) → media_history(id)
- creative_history(longform_video_media_id) → media_history(id)
- creative_history(app_install_icon_media_id) → media_history(id)
- creative_history(deep_link_icon_media_id) → media_history(id)
- ad_account_funding_source(ad_account_id) → ad_account_history(id)
- ad_account_funding_source(funding_source_id) → funding_source_history(id)
- ad_squad_delivery_status(ad_squad_id) → ad_squad_history(id)
- ad_squad_delivery_status(ad_squad_updated_at) → ad_squad_history(id)
- targeting_geolocation_history(ad_squad_id) → ad_squad_history(id)
- targeting_geolocation_history(ad_squad_updated_at) → ad_squad_history(id)
- ad_squad_placement_v_2_platform(ad_squad_id) → ad_squad_history(id)
- ad_squad_placement_v_2_platform(ad_squad_updated_at) → ad_squad_history(id)
- audience_segment_history(ad_account_id) → ad_account_history(id)
- creative_url_tag_history(creative_id) → creative_history(id)
- creative_url_tag_history(updated_at) → creative_history(id)
- ad_history(ad_squad_id) → ad_squad_history(id)
- ad_history(creative_id) → creative_history(id)
