Skip to content

Commit

Permalink
Merge pull request #53 from fivetran/feature/google-ads-api-default
Browse files Browse the repository at this point in the history
feature/google-ads-api-default
  • Loading branch information
fivetran-joemarkiewicz authored Jun 28, 2022
2 parents 056017e + d1e9d7e commit 84ce2f3
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
dbt seed --target postgres --full-refresh
dbt run --target postgres --full-refresh
dbt test --target postgres
dbt run --target postgres --full-refresh --vars '{api_source: google_ads}'
dbt run --target postgres --full-refresh --vars '{api_source: adwords}'
dbt test --target postgres
- run:
name: "Run Tests - Spark"
Expand All @@ -44,7 +44,7 @@ jobs:
dbt seed --target spark --full-refresh
dbt run --target spark --full-refresh
dbt test --target spark
dbt run --target spark --full-refresh --vars '{api_source: google_ads}'
dbt run --target spark --full-refresh --vars '{api_source: adwords}'
dbt test --target spark
- run:
name: "Run Tests - Redshift"
Expand All @@ -56,7 +56,7 @@ jobs:
dbt seed --target redshift --full-refresh
dbt run --target redshift --full-refresh
dbt test --target redshift
dbt run --target redshift --full-refresh --vars '{api_source: google_ads}'
dbt run --target redshift --full-refresh --vars '{api_source: adwords}'
dbt test --target redshift
- run:
name: "Run Tests - Snowflake"
Expand All @@ -68,7 +68,7 @@ jobs:
dbt seed --target snowflake --full-refresh
dbt run --target snowflake --full-refresh
dbt test --target snowflake
dbt run --target snowflake --full-refresh --vars '{api_source: google_ads}'
dbt run --target snowflake --full-refresh --vars '{api_source: adwords}'
dbt test --target snowflake
- run:
name: "Run Tests - BigQuery"
Expand All @@ -83,5 +83,5 @@ jobs:
dbt seed --target bigquery --full-refresh
dbt run --target bigquery --full-refresh
dbt test --target bigquery
dbt run --target bigquery --full-refresh --vars '{api_source: google_ads}'
dbt run --target bigquery --full-refresh --vars '{api_source: adwords}'
dbt test --target bigquery
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Pull Request
**Are you a current Fivetran customer?**
<!--- Please tell us your name, title and company -->

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# dbt_ad_reporting v0.8.0
## 🚨 Breaking Changes 🚨
- The `api_source` variable for the Google Ads package is now defaulted to `google_ads` as opposed to `adwords`. The Adwords API has since been deprecated by Google and is now no longer the standard API for the Google Ads connector. Please ensure you are using a Google Ads API version of the Fivetran connector before upgrading this package. ([#53](https://github.com/fivetran/dbt_ad_reporting/pull/53))
- Please note, the `adwords` version of this package will be fully removed from the package in August of 2022. This means, models under `models/adwords_connector` will be removed in favor of `models/google_ads_connector` models.

## Updates
- The `ad_reporting` final model is now materialized in a schema `<target_schema>_ad_reporting` by default. This may be overwritten if desired. ([#53](https://github.com/fivetran/dbt_ad_reporting/pull/53))
# dbt_ad_reporting v0.7.0
## 🚨 Breaking Changes 🚨
- The Google Ads dependency has been updated to now reference the latest version of the `dbt_google_ads` package (v0.6.0). This version of the package incorporates new and modified tables within the `Google Ads API` version of the connector. For more information, refer to the relevant [dbt_google_ads](https://github.com/fivetran/dbt_google_ads_source/releases/tag/v0.6.0) and [dbt_google_ads_source](https://github.com/fivetran/dbt_google_ads/releases/tag/v0.6.0) v0.6.0 release notes.
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Include in your `packages.yml`
```yaml
packages:
- package: fivetran/ad_reporting
version: [">=0.7.0", "<0.8.0"]
version: [">=0.8.0", "<0.9.0"]

```

Expand Down Expand Up @@ -114,10 +114,9 @@ models:
enabled: false
```
### Google Ads and Adwords API Configuration
This package allows users to leverage either the Adwords API or the Google Ads API if you have enabled the Google Ads connector. You will be able to determine which API your Google Ads connector is using by navigating within your Fivetran UI to the `setup` tab -> `edit connection details` link -> and reference the `API configuration` used. You will want to refer to the respective configuration steps below based off the API used by your connector.
This package allows users to leverage either the Adwords API or the Google Ads API. You will be able to determine which API your connector is using by navigating within your Fivetran UI to the `setup` tab -> `edit connection details` link -> and reference the `API configuration` used. You will want to refer to the respective configuration steps below based off the API used by your connector. You may set the api type by using the below config in your root `dbt_project.yml`.

#### Google Ads API
If your Google Ads connector is setup using the Google Ads API then you will need to configure your `dbt_project.yml` with the below variable:
> **Note**: As of April, 2022 all Fivetran Google Ads connectors leverage the Google Ads API rather than Adwords. Additionally, please be aware that the Adwords API version of the package will be sunset in August of 2022.

```yml
# dbt_project.yml
Expand All @@ -126,10 +125,10 @@ If your Google Ads connector is setup using the Google Ads API then you will nee
config-version: 2
vars:
api_source: google_ads ## adwords by default and is case sensitive!
api_source: google_ads ## google_ads by default, but may be changed to 'adwords' if using a previous version of the connector.
```
#### Adwords API
If your Google Ads connector is setup using the Adwords API (default) then you will want to follow the steps outlined in the [dbt_google_ads](https://github.com/fivetran/dbt_google_ads#adwords-api-configuration) package for configuring your package to leverage the adwords API.
If your Google Ads connector is setup using the Adwords API (no longer default) then you will want to follow the steps outlined in the [dbt_google_ads](https://github.com/fivetran/dbt_google_ads#adwords-api-configuration) package for configuring your package to leverage the adwords API.

### Data Location

Expand Down Expand Up @@ -172,6 +171,8 @@ By default this package will build all models in your <target_schema>. This beh
...
models:
ad_reporting:
+schema: ad_reporting
pinterest:
+schema: pinterest
pinterest_source:
Expand Down
3 changes: 2 additions & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'ad_reporting'
version: '0.7.0'
version: '0.8.0'
config-version: 2

require-dbt-version: [">=1.0.0", "<2.0.0"]
Expand All @@ -16,6 +16,7 @@ vars:

models:
ad_reporting:
+schema: ad_reporting
+materialized: view

pinterest:
Expand Down
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: 'ad_reporting_integration_tests'
version: '0.7.0'
version: '0.8.0'
profile: 'integration_tests'
config-version: 2

Expand Down
2 changes: 1 addition & 1 deletion models/stg_google_ads.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with base as (
'Google Ads' as platform,
cast(date_day as date) as date_day,
account_name,
{% if var('api_source','adwords') == 'google_ads' %} cast(account_id as {{ dbt_utils.type_string() }}) as account_id {% else %} cast(external_customer_id as {{ dbt_utils.type_string() }}) as account_id {% endif %} ,
{% if var('api_source','google_ads') == 'google_ads' %} cast(account_id as {{ dbt_utils.type_string() }}) as account_id {% else %} cast(external_customer_id as {{ dbt_utils.type_string() }}) as account_id {% endif %} ,
campaign_name,
cast(campaign_id as {{ dbt_utils.type_string() }}) as campaign_id,
ad_group_name,
Expand Down
2 changes: 1 addition & 1 deletion packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ packages:
version: [">=0.4.0", "<0.5.0"]

- package: fivetran/google_ads
version: [">=0.6.0", "<0.7.0"]
version: [">=0.7.0", "<0.8.0"]

- package: fivetran/tiktok_ads
version: [">=0.1.0", "<0.2.0"]
Expand Down

0 comments on commit 84ce2f3

Please sign in to comment.