# Apple Search Ads schema ERD

Table and field reference for the Fivetran Apple Search Ads connector.

## Table & Field Reference

### locale_device

| Column | Type | Keys |
| --- | --- | --- |
| language_code | String | PK |
| name | String | PK |
| product_page_id | String | PK, FK |

### ad_level_report

| Column | Type | Keys |
| --- | --- | --- |
| date | LocalDate | PK |
| ad_group_id | Long | PK, FK |
| ad_id | Long | PK, FK |
| campaign_id | Long | PK, FK |
| creative_id | Long | PK, FK |
| avg_cpm_amount | BigDecimal |  |
| avg_cpm_currency | String |  |
| avg_cpt_amount | BigDecimal |  |
| avg_cpt_currency | String |  |
| display_status | String |  |
| impressions | Int |  |
| language | String |  |
| local_spend_amount | BigDecimal |  |
| local_spend_currency | String |  |
| tap_install_cpi_amount | BigDecimal |  |
| tap_install_cpi_currency | String |  |
| tap_install_rate | BigDecimal |  |
| tap_installs | Long |  |
| tap_new_downloads | Long |  |
| tap_redownloads | Long |  |
| tap_through_rate | Float |  |
| taps | Int |  |
| total_avg_cpi_amount | BigDecimal |  |
| total_avg_cpi_currency | String |  |
| total_install_rate | BigDecimal |  |
| total_installs | Long |  |
| total_new_downloads | Long |  |
| total_redownloads | Long |  |
| view_installs | Long |  |
| view_new_downloads | Long |  |
| view_redownloads | Long |  |

### targeting_dimensions_history

| Column | Type | Keys |
| --- | --- | --- |
| type | String | PK |
| ad_group_id | Long | PK, FK |
| ad_group_modification_time | Instant | PK, FK |
| value | Json |  |

### product_page_history

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| modification_time | Instant | PK |
| adam_id | Long |  |
| creation_time | Instant |  |
| deep_link | String |  |
| name | String |  |
| state | String |  |

### ad_serving_state_reason_history

| Column | Type | Keys |
| --- | --- | --- |
| modification_time | Instant | PK |
| reason | String | PK |
| ad_id | Long | PK, FK |

### organization

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| currency | String |  |
| name | String |  |
| payment_model | String |  |
| role_names | Json |  |
| time_zone | String |  |

### impression_share_report

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| date | LocalDate | PK |
| organization_id | Long | PK, FK |
| adam_id | Long |  |
| app_name | String |  |
| country_or_region | String |  |
| high_impression_share | BigDecimal |  |
| low_impression_share | BigDecimal |  |
| rank | String |  |
| search_popularity | Int |  |
| search_term | String |  |

### search_term_report

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| date | LocalDate | PK |
| ad_group_id | Long | PK, FK |
| campaign_id | Long | PK, FK |
| keyword_id | Long | FK |
| ad_group_deleted | Boolean |  |
| ad_group_name | String |  |
| avg_cpm_amount | BigDecimal |  |
| avg_cpm_currency | String |  |
| avg_cpt_amount | BigDecimal |  |
| avg_cpt_currency | String |  |
| bid_amount_amount | BigDecimal |  |
| bid_amount_currency | String |  |
| deleted | Boolean |  |
| impressions | Int |  |
| keyword | String |  |
| keyword_display_status | String |  |
| local_spend_amount | BigDecimal |  |
| local_spend_currency | String |  |
| match_type | String |  |
| search_term_source | String |  |
| search_term_text | String |  |
| tap_install_cpi_amount | BigDecimal |  |
| tap_install_cpi_currency | String |  |
| tap_install_rate | BigDecimal |  |
| tap_installs | Long |  |
| tap_new_downloads | Long |  |
| tap_redownloads | Long |  |
| tap_through_rate | Float |  |
| taps | Int |  |
| total_avg_cpi_amount | BigDecimal |  |
| total_avg_cpi_currency | String |  |
| total_install_rate | BigDecimal |  |
| total_installs | Long |  |
| total_new_downloads | Long |  |
| total_redownloads | Long |  |
| view_installs | Long |  |
| view_new_downloads | Long |  |
| view_redownloads | Long |  |

### ad_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| modification_time | Instant | PK |
| ad_group_id | Long | FK |
| campaign_id | Long | FK |
| creative_id | Long | FK |
| org_id | Long | FK |
| creation_time | Instant |  |
| creative_type | String |  |
| deleted | Boolean |  |
| name | String |  |
| serving_status | String |  |
| status | String |  |

### creative_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| modification_time | Instant | PK |
| org_id | Long | FK |
| product_page_id | String | FK |
| adam_id | Long |  |
| creation_time | Instant |  |
| language_code | String |  |
| name | String |  |
| state | String |  |
| type | String |  |

### campaign_report

| Column | Type | Keys |
| --- | --- | --- |
| date | LocalDate | PK |
| id | Long | PK, FK |
| ad_channel_type | String |  |
| avg_cpm_amount | BigDecimal |  |
| avg_cpm_currency | String |  |
| avg_cpt_amount | BigDecimal |  |
| avg_cpt_currency | String |  |
| device_class | String |  |
| impressions | Int |  |
| local_spend_amount | BigDecimal |  |
| local_spend_currency | String |  |
| tap_install_cpi_amount | BigDecimal |  |
| tap_install_cpi_currency | String |  |
| tap_install_rate | BigDecimal |  |
| tap_installs | Long |  |
| tap_new_downloads | Long |  |
| tap_redownloads | Long |  |
| tap_through_rate | Float |  |
| taps | Int |  |
| total_avg_cpi_amount | BigDecimal |  |
| total_avg_cpi_currency | String |  |
| total_install_rate | BigDecimal |  |
| total_installs | Long |  |
| total_new_downloads | Long |  |
| total_redownloads | Long |  |
| view_installs | Long |  |
| view_new_downloads | Long |  |
| view_redownloads | Long |  |

### country_or_region_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Long | PK |
| campaign_id | Long | PK, FK |
| campaign_modification_time | Instant | PK, FK |
| country_or_region | String |  |

### keyword_report

| Column | Type | Keys |
| --- | --- | --- |
| date | LocalDate | PK |
| id | Long | PK, FK |
| avg_cpm_amount | BigDecimal |  |
| avg_cpm_currency | String |  |
| avg_cpt_amount | BigDecimal |  |
| avg_cpt_currency | String |  |
| impressions | Int |  |
| local_spend_amount | BigDecimal |  |
| local_spend_currency | String |  |
| tap_install_cpi_amount | BigDecimal |  |
| tap_install_cpi_currency | String |  |
| tap_install_rate | BigDecimal |  |
| tap_installs | Long |  |
| tap_new_downloads | Long |  |
| tap_redownloads | Long |  |
| tap_through_rate | Float |  |
| taps | Int |  |
| total_avg_cpi_amount | BigDecimal |  |
| total_avg_cpi_currency | String |  |
| total_install_rate | BigDecimal |  |
| total_installs | Long |  |
| total_new_downloads | Long |  |
| total_redownloads | Long |  |
| view_installs | Long |  |
| view_new_downloads | Long |  |
| view_redownloads | Long |  |

### negative_keyword_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| modification_time | Instant | PK |
| ad_group_id | Long | FK |
| campaign_id | Long | FK |
| deleted | Boolean |  |
| match_type | String |  |
| status | String |  |
| text | String |  |

### creative_state_reason_history

| Column | Type | Keys |
| --- | --- | --- |
| modification_time | Instant | PK |
| reason | String | PK |
| creative_id | Long | PK, FK |

### keyword_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| modification_time | Instant | PK |
| ad_group_id | Long | FK |
| campaign_id | Long | FK |
| bid_amount | BigDecimal |  |
| bid_currency | String |  |
| creation_time | Instant |  |
| deleted | Boolean |  |
| match_type | String |  |
| status | String |  |
| text | String |  |

### product_page_locale

| Column | Type | Keys |
| --- | --- | --- |
| language_code | String | PK |
| product_page_id | String | PK, FK |
| adam_id | Long |  |
| app_name | String |  |
| language | String |  |
| promotional_text | String |  |
| short_description | String |  |
| sub_title | String |  |

### ad_group_report

| Column | Type | Keys |
| --- | --- | --- |
| date | LocalDate | PK |
| ad_group_id | Long | PK, FK |
| avg_cpm_amount | BigDecimal |  |
| avg_cpm_currency | String |  |
| avg_cpt_amount | BigDecimal |  |
| avg_cpt_currency | String |  |
| device_class | String |  |
| impressions | Int |  |
| local_spend_amount | BigDecimal |  |
| local_spend_currency | String |  |
| tap_install_cpi_amount | BigDecimal |  |
| tap_install_cpi_currency | String |  |
| tap_install_rate | BigDecimal |  |
| tap_installs | Long |  |
| tap_new_downloads | Long |  |
| tap_redownloads | Long |  |
| tap_through_rate | Float |  |
| taps | Int |  |
| total_avg_cpi_amount | BigDecimal |  |
| total_avg_cpi_currency | String |  |
| total_install_rate | BigDecimal |  |
| total_installs | Long |  |
| total_new_downloads | Long |  |
| total_redownloads | Long |  |
| view_installs | Long |  |
| view_new_downloads | Long |  |
| view_redownloads | Long |  |

### campaign_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| modification_time | Instant | PK |
| organization_id | Long | FK |
| ad_channel_type | String |  |
| adam_id | Long |  |
| billing_event | String |  |
| budget_amount | BigDecimal |  |
| budget_currency | String |  |
| budget_orders | Json |  |
| creation_time | Instant |  |
| daily_budget_amount | BigDecimal |  |
| daily_budget_currency | String |  |
| deleted | Boolean |  |
| display_status | String |  |
| end_time | Instant |  |
| name | String |  |
| payment_model | String |  |
| serving_state_reasons | Json |  |
| serving_status | String |  |
| start_time | Instant |  |
| status | String |  |
| supply_sources | Json |  |
| loc_invoice_detail_** |  |  |

### ad_group_history

| Column | Type | Keys |
| --- | --- | --- |
| id | Long | PK |
| modification_time | Instant | PK |
| campaign_id | Long | FK |
| organization_id | Long | FK |
| automated_keywords_opt_in | Boolean |  |
| cpa_goal_amount | BigDecimal |  |
| cpa_goal_currency | String |  |
| default_bid_amount | BigDecimal |  |
| default_bid_currency | String |  |
| default_cpc_bid_amount | BigDecimal |  |
| default_cpc_bid_currency | String |  |
| deleted | Boolean |  |
| display_status | String |  |
| end_time | Instant |  |
| name | String |  |
| payment_model | String |  |
| pricing_model | String |  |
| serving_state_reasons | Json |  |
| serving_status | String |  |
| start_time | Instant |  |
| status | String |  |
| storefronts | Json |  |

## Relationships

- locale_device(product_page_id) → product_page_history(id)
- ad_level_report(ad_id) → ad_history(id)
- ad_level_report(campaign_id) → campaign_history(id)
- ad_level_report(ad_group_id) → ad_group_history(id)
- ad_level_report(creative_id) → creative_history(id)
- targeting_dimensions_history(ad_group_id) → ad_group_history(id)
- targeting_dimensions_history(ad_group_modification_time) → ad_group_history(id)
- ad_serving_state_reason_history(ad_id) → ad_history(id)
- impression_share_report(organization_id) → organization(id)
- search_term_report(campaign_id) → campaign_history(id)
- search_term_report(ad_group_id) → ad_group_history(id)
- search_term_report(keyword_id) → keyword_history(id)
- ad_history(org_id) → organization(id)
- ad_history(campaign_id) → campaign_history(id)
- ad_history(ad_group_id) → ad_group_history(id)
- ad_history(creative_id) → creative_history(id)
- creative_history(org_id) → organization(id)
- creative_history(product_page_id) → product_page_history(id)
- campaign_report(id) → campaign_history(id)
- country_or_region_history(campaign_id) → campaign_history(id)
- country_or_region_history(campaign_modification_time) → campaign_history(id)
- keyword_report(id) → keyword_history(id)
- negative_keyword_history(campaign_id) → campaign_history(id)
- negative_keyword_history(ad_group_id) → ad_group_history(id)
- creative_state_reason_history(creative_id) → creative_history(id)
- keyword_history(ad_group_id) → ad_group_history(id)
- keyword_history(campaign_id) → campaign_history(id)
- product_page_locale(product_page_id) → product_page_history(id)
- ad_group_report(ad_group_id) → ad_group_history(id)
- campaign_history(organization_id) → organization(id)
- ad_group_history(campaign_id) → campaign_history(id)
- ad_group_history(organization_id) → organization(id)
