Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
# dbt_microsoft_ads_source version.version
# dbt_microsoft_ads_source v0.11.0
[PR #39](https://github.com/fivetran/dbt_microsoft_ads_source/pull/39) includes the following changes:

## Breaking Changes:
- Updated `stg_microsoft_ads__ad_history` to include more name-related fields:
- `title`
- `title_part_1`
- `title_part_2`
- `title_part_3`
- `domain`
- For more information on these fields, refer to the [docs](https://fivetran.github.io/dbt_microsoft_ads_source/#!/model/model.microsoft_ads_source.stg_microsoft_ads__ad_history).

## Feature Updates:
- Introduced a new variable `microsoft_ads__ad_name_selector` to allow for `ad_name` in `stg_microsoft_ads__ad_history` to be customizable. By default `ad_name` is created from `title_part_1`, but you may override this by including the configuration shown below in your `dbt_project.yml` file. For more information, refer to the [README](https://github.com/fivetran/dbt_microsoft_ads_source/blob/main/README.md#change-how-ad-name-is-determined).

```yml
vars:
microsoft_ads__ad_name_selector: coalesce(title_part_2, title_part_1) # using `title_part_2`, with `title_part_1` as a fallback if the former is `null`.
```

## Under the Hood
- Updated the `ad_history` seed data, `get_account_history_columns`, `src_microsoft_ads.yml`, and `stg_microsoft_ads.yml` files with the new fields.

## Documentation
- Corrected references to connectors and connections in the README. ([#36](https://github.com/fivetran/dbt_microsoft_ads_source/pull/36))
- Updated License

# dbt_microsoft_ads_source v0.10.0
[PR #32](https://github.com/fivetran/dbt_microsoft_ads_source/pull/32) includes the following updates:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright © 2025 Fivetran Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ If you are **not** using the [Microsoft Ads transformation package](https://git
```yaml
packages:
- package: fivetran/microsoft_ads_source
version: [">=0.10.0", "<0.11.0"]
version: [">=0.11.0", "<0.12.0"]
```
### Step 3: Define database and schema variables
By default, this package runs using your destination and the `microsoft_ads` schema. If this is not where your Microsoft Ads data is (for example, if your microsoft_ads schema is named `microsoft_ads_fivetran`), add the following configuration to your root `dbt_project.yml` file:
Expand Down Expand Up @@ -98,6 +98,18 @@ vars:
- name: "unique_string_field"
alias: "field_id"
```

#### Change how ad name is determined

In the `stg_microsoft_ads__ad_history` model we have made `ad_name` configurable. While `ad_name` by default uses the `title_part_1` field, users may wish to use a different field or a combination of fields to generate the `ad_name`. You may do so by configuring the `microsoft_ads__ad_name_selector` variable as follows:

```yml
vars:
microsoft_ads__ad_name_selector: coalesce(title_part_2, title_part_1) # using `title_part_2`, with `title_part_1` as a fallback if the former is `null`.
```

</details>

#### Change the build schema
By default, this package builds the Microsoft Ads staging models (11 views, 11 tables) within a schema titled (`<target_schema>` + `_microsoft_ads_source`) in your destination. If this is not where you would like your Microsoft Ads staging data to be written to, add the following configuration to your root `dbt_project.yml` file:

Expand All @@ -116,8 +128,6 @@ vars:
microsoft_ads_<default_source_table_name>_identifier: your_table_name
```

</details>

### (Optional) Step 5: Orchestrate your models with Fivetran Transformations for dbt Core™
<details><summary>Expand for more details</summary>

Expand Down
4 changes: 2 additions & 2 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: 'microsoft_ads_source'
version: '0.10.0'

version: '0.11.0'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
vars:
Expand All @@ -16,6 +15,7 @@ vars:
keyword_history: "{{ source('microsoft_ads','keyword_history') }}"
keyword_performance_daily_report: "{{ source('microsoft_ads', 'keyword_performance_daily_report') }}"
search_performance_daily_report: "{{ source('microsoft_ads', 'search_query_performance_daily_report') }}"

microsoft_ads__account_passthrough_metrics: []
microsoft_ads__campaign_passthrough_metrics: []
microsoft_ads__ad_group_passthrough_metrics: []
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'microsoft_ads_source_integration_tests'
version: '0.10.0'
version: '0.11.0'

profile: 'integration_tests'
config-version: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ date,account_id,device_os,device_type,network,currency_code,ad_distribution,bid_
2018-12-06,150175881,Unknown,Computer,AOL search,USD,Search,Phrase,Phrase,AOL search - Top,0,0,0.0,0,0,0.0,0
2019-04-15,150175881,Windows,Computer,AOL search,USD,Search,Broad,Broad,AOL search - Top,0,0,0.0,0,0,0.0,0
2019-04-16,150175881,Unknown,Computer,AOL search,USD,Search,Broad,Broad,AOL search - Top,0,0,0.0,0,0,0.0,0
2018-12-26,150175881,Windows,Computer,AOL search,USD,Search,Broad,Phrase,AOL search - Top,4,5,0.0,1,2,0.1,3
2018-12-26,150175881,Windows,Computer,AOL search,USD,Search,Broad,Phrase,AOL search - Top,4,5,0.0,1,2,0.01,3
22 changes: 11 additions & 11 deletions integration_tests/seeds/microsoft_ads_ad_history_data.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
id,title_part_1,final_url,ad_group_id,modified_time,status,type
83769087188948,LKxLUP62OMuqYOnH5orp0A==,https://fivetran.com/directory/marketo,1340304934202281,2019-04-18T13:49:15.253Z,Active,Expanded Text Ad
83769087188947,8megrr5FKm6ChQILJK65Cg==,https://fivetran.com/directory/google-analytics,1340304934202265,2019-04-18T13:49:15.253Z,Active,Expanded Text Ad
83631648270348,VDc1NVjlQblN+eNbripfsQ==,https://fivetran.com/directory/facebook-ads-account,1338105911256023,2019-04-18T13:49:16.373Z,Active,Expanded Text Ad
83631648270349,e7L/v/fiGh2rg37b19Quew==,https://fivetran.com/directory/intercom,1338105911256039,2019-04-18T13:49:16.373Z,Active,Expanded Text Ad
83425489849365,Ggg6SfVdFT+XvFwzXH5f7w==,https://fivetran.com/directory/bing-ads,1334807376555988,2019-04-18T13:49:11.797Z,Active,Expanded Text Ad
83425489849364,7Wzn6woQmbWz7u9JX7VLrQ==,https://fivetran.com/directory/amazon-dynamodb,1334807376555972,2019-04-18T13:49:11.797Z,Active,Expanded Text Ad
84181395865934,WwfGmlh/43PQDdH8bbMi9Q==,http://fivetran.com/,1346901938949055,2019-04-18T13:46:01.610Z,Active,Expanded Text Ad
84181395865928,WwfGmlh/43PQDdH8bbMi9Q==,http://fivetran.com/,1346901938949023,2019-04-18T13:46:01.610Z,Active,Expanded Text Ad
84181395865931,WwfGmlh/43PQDdH8bbMi9Q==,https://fivetran.com/demo,1346901938949039,2019-04-18T13:46:01.610Z,Active,Expanded Text Ad
84181395865939,WwfGmlh/43PQDdH8bbMi9Q==,http://fivetran.com/,1346901938949071,2019-04-18T13:46:01.610Z,Active,Expanded Text Ad
id,title_part_1,final_url,ad_group_id,modified_time,status,type,title,title_part_2,title_part_3,domain
83769087188948,LKxLUP62OMuqYOnH5orp0A==,https://fivetran.com/directory/marketo,1340304934202281,2019-04-18T13:49:15.253Z,Active,Expanded Text Ad,Connect Marketo with Fivetran,Automate Your Data Pipeline,No Maintenance Required,fivetran.com
83769087188947,8megrr5FKm6ChQILJK65Cg==,https://fivetran.com/directory/google-analytics,1340304934202265,2019-04-18T13:49:15.253Z,Active,Expanded Text Ad,Google Analytics Integration,Sync Your Analytics Data,No Maintenance Required,fivetran.com
83631648270348,VDc1NVjlQblN+eNbripfsQ==,https://fivetran.com/directory/facebook-ads-account,1338105911256023,2019-04-18T13:49:16.373Z,Active,Expanded Text Ad,Facebook Ads Data Connector,Seamless Facebook Ads Sync,Start Analyzing Data Instantly,fivetran.com
83631648270349,e7L/v/fiGh2rg37b19Quew==,https://fivetran.com/directory/intercom,1338105911256039,2019-04-18T13:49:16.373Z,Active,Expanded Text Ad,Intercom Data Sync,Automate Customer Data Transfer,Integrate in Minutes,fivetran.com
83425489849365,Ggg6SfVdFT+XvFwzXH5f7w==,https://fivetran.com/directory/bing-ads,1334807376555988,2019-04-18T13:49:11.797Z,Active,Expanded Text Ad,Bing Ads Data Integration,Easy Bing Ads Reporting,Automate Your Marketing Data,fivetran.com
83425489849364,7Wzn6woQmbWz7u9JX7VLrQ==,https://fivetran.com/directory/amazon-dynamodb,1334807376555972,2019-04-18T13:49:11.797Z,Active,Expanded Text Ad,Amazon DynamoDB Sync,Seamless No-Code ETL,Fast & Reliable Data Pipelines,fivetran.com
84181395865934,WwfGmlh/43PQDdH8bbMi9Q==,http://fivetran.com/,1346901938949055,2019-04-18T13:46:01.610Z,Active,Expanded Text Ad,Fivetran: Automated Data Pipelines,ETL Without the Hassle,Get Started in Minutes,fivetran.com
84181395865928,WwfGmlh/43PQDdH8bbMi9Q==,http://fivetran.com/,1346901938949023,2019-04-18T13:46:01.610Z,Active,Expanded Text Ad,Fivetran: Automated Data Pipelines,Connect Your Data Effortlessly,Get Started in Minutes,fivetran.com
84181395865931,WwfGmlh/43PQDdH8bbMi9Q==,https://fivetran.com/demo,1346901938949039,2019-04-18T13:46:01.610Z,Active,Expanded Text Ad,Fivetran Demo - See It in Action,Try Our Hands-On Demo Today,See How It Works,fivetran.com
84181395865939,WwfGmlh/43PQDdH8bbMi9Q==,http://fivetran.com/,1346901938949071,2019-04-18T13:46:01.610Z,Active,Expanded Text Ad,Fivetran: Automated Data Pipelines,ETL Without the Hassle,Get Started in Minutes,fivetran.com
6 changes: 5 additions & 1 deletion macros/get_ad_history_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

{% set columns = [
{"name": "id", "datatype": dbt.type_int()},
{"name": "title", "datatype": dbt.type_string()},
{"name": "title_part_1", "datatype": dbt.type_string()},
{"name": "title_part_2", "datatype": dbt.type_string()},
{"name": "title_part_3", "datatype": dbt.type_string()},
{"name": "final_url", "datatype": dbt.type_string()},
{"name": "ad_group_id", "datatype": dbt.type_int()},
{"name": "modified_time", "datatype": dbt.type_timestamp()},
{"name": "status", "datatype": dbt.type_string()},
{"name": "type", "datatype": dbt.type_string()}
{"name": "type", "datatype": dbt.type_string()},
{"name": "domain", "datatype": dbt.type_string()}
] %}

{{ return(columns) }}
Expand Down
22 changes: 21 additions & 1 deletion models/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The status of this ad group; see the following [documentation](https://help.ads.
{% enddocs %}

{% docs ad_name %}
The name of the corresponding ad; `title_part_1` is used as the ad name as a proxy as one is not provided by the data source.
The name of the corresponding ad; `title_part_1` is used as the default ad name but you may customize this by using the `microsoft_ads__ad_name_selector` variable. For more information, refer to the [README](https://github.com/fivetran/dbt_microsoft_ads_source/blob/main/README.md#change-how-ad-name-is-determined).
{% enddocs %}

{% docs ad_group_id %}
Expand Down Expand Up @@ -201,4 +201,24 @@ The position of the ad associated with this record. For more information, refer

{% docs source_relation %}
The source of the record if the unioning functionality is being used. If not this field will be empty.
{% enddocs %}

{% docs title %}
The title of the ad.
{% enddocs %}

{% docs title_part_1 %}
Part 1 of the title.
{% enddocs %}

{% docs title_part_2 %}
Part 2 of the title.
{% enddocs %}

{% docs title_part_3 %}
Part 3 of the title.
{% enddocs %}

{% docs domain %}
The associated domain that the ad links to.
{% enddocs %}
12 changes: 12 additions & 0 deletions models/src_microsoft_ads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,18 @@ sources:
description: '{{ doc("ad_status") }}'
- name: type
description: '{{ doc("ad_type") }}'
- name: title
description: '{{ doc("title") }}'
- name: title_part_1
description: '{{ doc("title_part_1") }}'
- name: title_part_2
description: '{{ doc("title_part_2") }}'
- name: title_part_3
description: '{{ doc("title_part_3") }}'
- name: final_url
description: '{{ doc("final_url") }}'
- name: domain
description: '{{ doc("domain") }}'

- name: ad_performance_daily_report
identifier: "{{ var('microsoft_ads_ad_performance_daily_report_identifier', 'ad_performance_daily_report') }}"
Expand Down
12 changes: 12 additions & 0 deletions models/stg_microsoft_ads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,18 @@ models:
description: '{{ doc("ad_status") }}'
- name: type
description: '{{ doc("ad_type") }}'
- name: title
description: '{{ doc("title") }}'
- name: title_part_1
description: '{{ doc("title_part_1") }}'
- name: title_part_2
description: '{{ doc("title_part_2") }}'
- name: title_part_3
description: '{{ doc("title_part_3") }}'
- name: final_url
description: '{{ doc("final_url") }}'
- name: domain
description: '{{ doc("domain") }}'
- name: is_most_recent_record
description: '{{ doc("is_most_recent_record") }}'

Expand Down
7 changes: 6 additions & 1 deletion models/stg_microsoft_ads__ad_history.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ final as (
select
source_relation,
id as ad_id,
title_part_1 as ad_name,
{{ var('microsoft_ads__ad_name_selector', 'title_part_1') }} as ad_name,
title,
title_part_1,
title_part_2,
title_part_3,
final_url,
domain,
ad_group_id,
modified_time as modified_at,
status,
Expand Down