# Tiktok Ads schema ERD

Table and field reference for the Fivetran Tiktok Ads connector.

## Table & Field Reference

### ad_image

| Column | Type | Keys |
| --- | --- | --- |
| ad_id | Long | PK, FK |
| image_id | String | PK, FK |

### advertiser

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| address | String |  |
| advertiser_account_type | String |  |
| balance | Double |  |
| cellphone_number | String |  |
| company | String |  |
| company_name_editable | Boolean |  |
| contacter | String |  |
| country | String |  |
| create_time | Instant |  |
| currency | String |  |
| description | String |  |
| email | String |  |
| industry | String |  |
| language | String |  |
| license_no | String |  |
| license_url | String |  |
| name | String |  |
| promotion_area | String |  |
| rejection_reason | String |  |
| role | String |  |
| status | String |  |
| telephone_number | String |  |
| timezone | String |  |

### utm_param

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| ad_id | Long | PK, FK |
| custom_parameters | Json |  |
| utm_campaign | String |  |
| utm_content | String |  |
| utm_medium | String |  |
| utm_source | String |  |
| utm_term | String |  |

### smart_creative_material_media_info_history

| Column | Type | Keys |
| --- | --- | --- |
| material_id | Long | PK |
| adgroup_id | Long | PK, FK |
| advertiser_id | Long | PK, FK |
| material_operation_status | String |  |
| media_info_** |  |  |

### campaign_history

| Column | Type | Keys |
| --- | --- | --- |
| campaign_id | Long | PK |
| updated_at | Instant | PK |
| advertiser_id | Long | FK |
| app_id | String |  |
| app_promotion_type | String |  |
| bid_type | String |  |
| budget | Double |  |
| budget_mode | String |  |
| budget_optimize_on | Boolean |  |
| buying_type | String |  |
| campaign_app_profile_page_state | String |  |
| campaign_automation_type | String |  |
| campaign_name | String |  |
| campaign_product_source | String |  |
| campaign_type | String |  |
| create_time | Instant |  |
| deep_bid_type | String |  |
| is_advanced_dedicated_campaign | Boolean |  |
| is_new_structure | String |  |
| is_search_campaign | Boolean |  |
| is_smart_performance_campaign | Boolean |  |
| objective | String |  |
| objective_type | String |  |
| operation_status | String |  |
| optimization_goal | String |  |
| postback_window_mode | String |  |
| rf_campaign_type | String |  |
| roas_bid | Double |  |
| rta_id | String |  |
| rta_product_selection_enabled | Boolean |  |
| secondary_status | String |  |
| split_test_variable | String |  |

### smart_creative_material_history

| Column | Type | Keys |
| --- | --- | --- |
| adgroup_id | Long | PK, FK |
| advertiser_id | Long | PK, FK |
| avatar_icon_list | Json |  |
| call_to_action_list | Json |  |
| card_list | Json |  |
| deeplink_list | Json |  |
| display_name_list | Json |  |
| landing_page_urls | Json |  |
| page_list | Json |  |
| common_material_** |  |  |

### pixel

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| advertiser_id | Long | PK, FK |
| advanced_matching_field_email | Boolean |  |
| advanced_matching_field_phone_number | Boolean |  |
| code | String |  |
| create_time | Instant |  |
| name | String |  |
| partner_name | String |  |
| script | String |  |
| setup_mode | String |  |
| asset_ownership_** |  |  |

### pixel_event_rule

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| event_id | Long | PK, FK |
| operator | String |  |
| trigger | String |  |
| value | String |  |
| variable | String |  |

### adgroup_history

| Column | Type | Keys |
| --- | --- | --- |
| adgroup_id | Long | PK |
| updated_at | Instant | PK |
| advertiser_id | Long | FK |
| campaign_id | Long | FK |
| action_categories | Json |  |
| action_days | Int |  |
| adgroup_app_profile_page_state | String |  |
| adgroup_name | String |  |
| age_groups | Json |  |
| app_config_app_ids | Json |  |
| app_download_url | String |  |
| app_id | Long |  |
| app_name | String |  |
| app_type | String |  |
| attribution_event_count | String |  |
| audience | Json |  |
| audience_type | String |  |
| automated_keywords_enabled | Boolean |  |
| bid_display_mode | String |  |
| bid_price | Double |  |
| bid_type | String |  |
| billing_event | String |  |
| brand_safety_partner | String |  |
| brand_safety_type | String |  |
| budget | Double |  |
| budget_mode | String |  |
| buying_type | String |  |
| category | Int |  |
| click_attribution_window | String |  |
| comment_disabled | Boolean |  |
| conversion_bid_price | Double |  |
| cpm | Double |  |
| cpv_video_duration | String |  |
| create_time | Instant |  |
| creative_material_mode | String |  |
| custom_conversion_id | String |  |
| dayparting | String |  |
| deep_bid_type | String |  |
| deep_cpa_bid | Double |  |
| deep_funnel_event_source | String |  |
| deep_funnel_event_source_id | String |  |
| deep_funnel_optimization_event | String |  |
| deep_funnel_optimization_status | String |  |
| delivery_mode | String |  |
| discount_amount | Double |  |
| discount_percentage | Double |  |
| discount_type | String |  |
| display_name | String |  |
| engaged_view_attribution_window | String |  |
| excluded_audience | Json |  |
| fallback_type | String |  |
| feed_type | String |  |
| frequency | Int |  |
| frequency_schedule | Int |  |
| gender | String |  |
| identity_authorized_bc_id | String |  |
| identity_id | String |  |
| identity_type | String |  |
| interest_category_v_2 | Json |  |
| inventory_filter_enabled | Boolean |  |
| ios_14_quota_type | String |  |
| ios_14_targeting | String |  |
| is_comment_disable | Int |  |
| is_hfss | Boolean |  |
| is_lhf_compliance | Boolean |  |
| is_new_structure | Boolean |  |
| is_smart_performance_campaign | Boolean |  |
| keywords | Json |  |
| landing_page_url | String |  |
| languages | Json |  |
| location | Json |  |
| message_event_set_id | String |  |
| messaging_app_account_id | String |  |
| messaging_app_type | String |  |
| min_android_version | String |  |
| min_ios_version | String |  |
| network_types | Json |  |
| next_day_retention | Double |  |
| open_url | String |  |
| open_url_type | String |  |
| operating_systems | Json |  |
| operation_status | String |  |
| optimization_event | String |  |
| optimization_goal | String |  |
| pacing | String |  |
| package | String |  |
| pangle_block_app_list_id | Json |  |
| phone_number | String |  |
| phone_region_calling_code | String |  |
| phone_region_code | String |  |
| pixel_id | Long |  |
| placement_type | String |  |
| placements | Json |  |
| pre_discount_budget | Double |  |
| pre_discount_cpm | Double |  |
| predict_impression | Int |  |
| product_source | String |  |
| profile_image | String |  |
| promotion_target_type | String |  |
| promotion_type | String |  |
| promotion_website_type | String |  |
| purchased_impression | Int |  |
| purchased_reach | Int |  |
| rf_estimated_cpr | Double |  |
| rf_estimated_frequency | Double |  |
| rf_purchased_type | String |  |
| roas_bid | Double |  |
| saved_audience_id | String |  |
| schedule_end_time | Instant |  |
| schedule_start_time | Instant |  |
| schedule_type | String |  |
| scheduled_budget | Double |  |
| search_result_enabled | Boolean |  |
| secondary_optimization_event | String |  |
| secondary_status | String |  |
| share_disabled | Boolean |  |
| shopping_ads_retargeting_actions_days | Int |  |
| shopping_ads_retargeting_custom_audience_relation | String |  |
| shopping_ads_retargeting_type | String |  |
| shopping_ads_type | String |  |
| skip_learning_phase | Int |  |
| smart_audience_enabled | Boolean |  |
| smart_interest_behavior_enabled | Boolean |  |
| spending_power | String |  |
| split_test_group_id | String |  |
| split_test_status | String |  |
| statistic_type | String |  |
| store_authorized_bc_id | String |  |
| store_id | String |  |
| tiktok_subplacements | Json |  |
| vbo_window | String |  |
| vertical_sensitivity_id | String |  |
| video_actions | Json |  |
| video_download | String |  |
| video_download_disabled | Boolean |  |
| view_attribution_window | String |  |

### image_history

| Column | Type | Keys |
| --- | --- | --- |
| image_id | String | PK |
| updated_at | Instant | PK |
| advertiser_id | String | FK |
| created_at | Instant |  |
| displayable | Boolean |  |
| file_name | String |  |
| format | String |  |
| height | Int |  |
| image_url | String |  |
| is_carousel_usable | Boolean |  |
| material_id | String |  |
| signature | String |  |
| size | Int |  |
| width | Int |  |

### adgroup_search_keyword_history

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| adgroup_id | Long | FK |
| audit_status | String |  |
| keyword | String |  |
| keyword_bid | Double |  |
| keyword_bid_type | String |  |
| match_type | String |  |

### creative_history

| Column | Type | Keys |
| --- | --- | --- |
| creative_id | Long | PK |
| updated_at | Instant | PK |
| adgroup_id | Long | FK |
| advertiser_id | Long | FK |
| campaign_id | Long | FK |
| smart_plus_ad_id | String | FK |
| video_id | String | FK |
| ad_text | String |  |
| adgroup_name | String |  |
| campaign_automation_type | String |  |
| campaign_name | String |  |
| create_time | Instant |  |
| creative_name | String |  |
| identity_id | String |  |
| identity_type | String |  |
| image_ids | Json |  |
| operation_status | String |  |
| secondary_status | String |  |
| tiktok_item_id | String |  |

### pixel_event

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| pixel_id | Long | FK |
| code | String |  |
| currency | String |  |
| currency_value | String |  |
| custom_event_type | String |  |
| deprecated | Boolean |  |
| id | Long |  |
| name | String |  |
| optimization_event | String |  |
| statistic_type | String |  |
| type | String |  |

### smart_plus_ad_creative_info

| Column | Type | Keys |
| --- | --- | --- |
| ad_material_id | Long | PK |
| smart_plus_ad_id | Long | FK |
| ad_format | String |  |
| aigc_disclosure_type | String |  |
| identity_authorized_bc_id | String |  |
| identity_id | String |  |
| identity_type | String |  |
| image_info | Json |  |
| material_name | String |  |
| material_operation_status | String |  |
| music_info_music_id | String |  |
| smart_plus_creative_id | String |  |
| tiktok_item_id | String |  |
| video_info_file_name | String |  |
| video_info_video_id | String |  |

### gmv_max_campaign_history

| Column | Type | Keys |
| --- | --- | --- |
| campaign_id | Long | PK |
| updated_at | Instant | PK |
| advertiser_id | Long | FK |
| campaign_name | String |  |
| create_time | Instant |  |
| gmx_max_promotion_type | String |  |
| objective_type | String |  |
| operation_status | String |  |
| roi_protection_compensation_status | String |  |
| secondary_status | String |  |

### smart_plus_ad_deeplink_utm_param

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| smart_plus_ad_id | Long | FK |
| custom_parameters | Json |  |
| utm_campaign | String |  |
| utm_content | String |  |
| utm_medium | String |  |
| utm_source | String |  |

### shop

| Column | Type | Keys |
| --- | --- | --- |
| store_id | String | PK |
| exclusive_authorized_advertiser_info_advertiser_id | Long | FK |
| exclusive_authorized_advertiser_info_advertiser_name | String |  |
| exclusive_authorized_advertiser_info_advertiser_status | String |  |
| is_gmv_max_available | Boolean |  |
| is_owner_bc | Boolean |  |
| store_authorized_bc_id | String |  |
| store_code | String |  |
| store_name | String |  |
| store_role | String |  |
| store_status | String |  |
| targeting_region_codes | Json |  |
| thumbnail_url | String |  |
| store_authorized_bc_info_** |  |  |

### ad_history

| Column | Type | Keys |
| --- | --- | --- |
| ad_id | Long | PK |
| updated_at | Instant | PK |
| adgroup_id | Long | FK |
| advertiser_id | Long | FK |
| campaign_id | Long | FK |
| video_id | String | FK |
| ad_format | String |  |
| ad_name | String |  |
| ad_text | String |  |
| adgroup_name | String |  |
| aigc_disclosure_type | String |  |
| app_name | String |  |
| avatar_icon_web_uri | String |  |
| brand_safety_postbid_partner | String |  |
| brand_safety_vast_url | String |  |
| branded_content_disabled | Boolean |  |
| buying_type | String |  |
| call_to_action | String |  |
| call_to_action_id | String |  |
| campaign_automation_type | String |  |
| campaign_name | String |  |
| card_id | String |  |
| carousel_image_index | Int |  |
| click_tracking_url | String |  |
| cpp_url | String |  |
| create_time | Instant |  |
| creative_authorized | Boolean |  |
| creative_type | String |  |
| dark_post_status | String |  |
| deeplink | String |  |
| deeplink_type | String |  |
| display_name | String |  |
| dynamic_destination | String |  |
| dynamic_format | String |  |
| fallback_type | String |  |
| identity_authorized_bc_id | String |  |
| identity_id | String |  |
| identity_type | String |  |
| impression_tracking_url | String |  |
| is_aco | Boolean |  |
| is_new_structure | Boolean |  |
| item_duet_status | String |  |
| item_stitch_status | String |  |
| landing_page_url | String |  |
| music_id | String |  |
| operation_status | String |  |
| optimization_event | String |  |
| page_id | String |  |
| phone_number | String |  |
| phone_region_calling_code | String |  |
| phone_region_code | String |  |
| playable_url | String |  |
| product_set_id | String |  |
| product_specific_type | String |  |
| profile_image_url | String |  |
| promotional_music_disabled | Boolean |  |
| secondary_status | String |  |
| shopping_ads_deeplink_type | String |  |
| shopping_ads_fallback_type | String |  |
| shopping_ads_video_package_id | String |  |
| smart_plus_ad_id | String |  |
| tiktok_item_id | String |  |
| tiktok_page_category | String |  |
| tracking_app_id | String |  |
| tracking_pixel_id | String |  |
| vast_moat_enabled | Boolean |  |
| vertical_video_strategy | String |  |
| viewability_postbid_partner | String |  |
| viewability_vast_url | String |  |

### smart_plus_ad_utm_param

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| smart_plus_ad_id | Long | FK |
| custom_parameters | Json |  |
| utm_campaign | String |  |
| utm_content | String |  |
| utm_medium | String |  |
| utm_source | String |  |

### smart_plus_ad_history

| Column | Type | Keys |
| --- | --- | --- |
| smart_plus_ad_id | Long | PK |
| updated_at | Instant | PK |
| adgroup_id | Long | FK |
| advertiser_id | Long | FK |
| campaign_id | Long | FK |
| ad_name | String |  |
| ad_text_list | Json |  |
| adgroup_name | String |  |
| auto_disclaimer_types | Json |  |
| auto_message_list | Json |  |
| call_to_action_id | String |  |
| call_to_action_list | Json |  |
| campaign_name | String |  |
| catalog_creative_toggle | Boolean |  |
| create_time | Instant |  |
| creative_auto_add_toggle | Boolean |  |
| custom_product_page_list | Json |  |
| dark_post_status | String |  |
| deeplink_list | Json |  |
| end_card_cta | String |  |
| fallback_type | String |  |
| identity_id | String |  |
| identity_type | String |  |
| interactive_add_on_list | Json |  |
| landing_page_url_list | Json |  |
| operation_status | String |  |
| page_list | Json |  |
| phone_info_phone_number | String |  |
| phone_info_phone_region_calling_code | String |  |
| phone_info_phone_region_code | String |  |
| product_display_field_list | Json |  |
| product_ids | Json |  |
| product_info_selling_points | Json |  |
| product_set_id | String |  |
| product_specific_type | String |  |
| secondary_status | String |  |
| tracking_info_click_tracking_url | String |  |
| tracking_info_impression_tracking_url | String |  |
| tracking_info_tracking_app_id | String |  |
| tracking_info_tracking_message_event_set_id | String |  |

### location

| Column | Type | Keys |
| --- | --- | --- |
| region_id | String | PK |
| advertiser_id | Long | PK, FK |
| area_type | String |  |
| country_code | String |  |
| parent_id | String |  |
| region_level | String |  |
| region_name | String |  |
| support_below_18 | Boolean |  |

### pixel_statistic

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| advertiser_id | Long | PK, FK |
| pixel_id | Long | PK, FK |
| attributed_count | Long |  |
| browser_event_total_count | Long |  |
| pixel_event_type | String |  |
| preview_count | Long |  |
| server_event_total_count | Long |  |
| total_count | Long |  |

### video_history

| Column | Type | Keys |
| --- | --- | --- |
| updated_at | Instant | PK |
| video_id | String | PK |
| advertiser_id | String | FK |
| allow_download | Boolean |  |
| allowed_placements | Json |  |
| bit_rate | Double |  |
| create_time | String |  |
| displayable | Boolean |  |
| duration | Float |  |
| file_name | String |  |
| format | String |  |
| height | Int |  |
| material_id | String |  |
| preview_url | String |  |
| preview_url_expire_time | String |  |
| signature | String |  |
| size | Int |  |
| video_cover_url | String |  |
| width | Int |  |

### smart_creative_material_ad_title_history

| Column | Type | Keys |
| --- | --- | --- |
| material_id | Long | PK |
| adgroup_id | Long | PK, FK |
| advertiser_id | Long | PK, FK |
| material_operation_status | String |  |
| title | String |  |

## Relationships

- ad_image(ad_id) → ad_history(ad_id)
- ad_image(image_id) → image_history(image_id)
- utm_param(ad_id) → ad_history(ad_id)
- smart_creative_material_media_info_history(advertiser_id) → smart_creative_material_history(advertiser_id)
- smart_creative_material_media_info_history(adgroup_id) → smart_creative_material_history(advertiser_id)
- campaign_history(advertiser_id) → advertiser(id)
- smart_creative_material_history(advertiser_id) → advertiser(id)
- smart_creative_material_history(adgroup_id) → adgroup_history(adgroup_id)
- pixel(advertiser_id) → advertiser(id)
- pixel_event_rule(event_id) → pixel_event(_fivetran_id)
- adgroup_history(advertiser_id) → advertiser(id)
- adgroup_history(campaign_id) → campaign_history(campaign_id)
- image_history(advertiser_id) → advertiser(id)
- adgroup_search_keyword_history(adgroup_id) → adgroup_history(adgroup_id)
- creative_history(smart_plus_ad_id) → smart_plus_ad_history(smart_plus_ad_id)
- creative_history(advertiser_id) → advertiser(id)
- creative_history(adgroup_id) → adgroup_history(adgroup_id)
- creative_history(campaign_id) → campaign_history(campaign_id)
- creative_history(video_id) → video_history(video_id)
- pixel_event(pixel_id) → pixel(advertiser_id)
- smart_plus_ad_creative_info(smart_plus_ad_id) → smart_plus_ad_history(smart_plus_ad_id)
- gmv_max_campaign_history(advertiser_id) → advertiser(id)
- smart_plus_ad_deeplink_utm_param(smart_plus_ad_id) → smart_plus_ad_history(smart_plus_ad_id)
- shop(exclusive_authorized_advertiser_info_advertiser_id) → advertiser(id)
- ad_history(advertiser_id) → advertiser(id)
- ad_history(adgroup_id) → adgroup_history(adgroup_id)
- ad_history(campaign_id) → campaign_history(campaign_id)
- ad_history(video_id) → video_history(video_id)
- smart_plus_ad_utm_param(smart_plus_ad_id) → smart_plus_ad_history(smart_plus_ad_id)
- smart_plus_ad_history(advertiser_id) → advertiser(id)
- smart_plus_ad_history(adgroup_id) → adgroup_history(adgroup_id)
- smart_plus_ad_history(campaign_id) → campaign_history(campaign_id)
- location(advertiser_id) → advertiser(id)
- pixel_statistic(pixel_id) → pixel(advertiser_id)
- pixel_statistic(advertiser_id) → advertiser(id)
- video_history(advertiser_id) → advertiser(id)
- smart_creative_material_ad_title_history(advertiser_id) → smart_creative_material_history(advertiser_id)
- smart_creative_material_ad_title_history(adgroup_id) → smart_creative_material_history(advertiser_id)
