You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* things are running
* working and tests passing
* docs
* polishes
* joe feedback
* adjust field names to be consistent
* source package ref - buildkite will fail
* document 2 vars
Copy file name to clipboardExpand all lines: CHANGELOG.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,28 @@
1
+
# dbt_twitter v0.8.0
2
+
3
+
[PR #26](https://github.com/fivetran/dbt_twitter/pull/26) includes the following **BREAKING CHANGE** updates:
4
+
5
+
## Feature Updates: Native Conversion Support
6
+
We have added more robust support for conversions in our data models by doing the following:
7
+
- Created the `twitter_ads__conversion_fields` and `twitter_ads__conversion_sale_amount_fields` variables to pass through conversion metrics (total number and monetary value, respectively). Conversion metrics are split into these 2 variables due to the N:1 relationship between Twitter conversions and their conversion value fields.
8
+
- By default, `twitter_ads__conversion_fields` will include `conversion_purchases_metric` and `conversion_custom_metric`.
9
+
- By default, `twitter_ads__conversion_sale_amount_fields` will include `conversion_purchases_sale_amount` and `conversion_custom_sale_amount`.
10
+
- These conversion fields will be included in each end model report. Additionally, they will be summed up into new `total_conversions` and `total_conversions_sale_amount` columns.
11
+
- See [README](https://github.com/fivetran/dbt_twitter?tab=readme-ov-file#customizing-types-of-conversions) for more details on how to configure these variables.
12
+
13
+
## Under the Hood
14
+
- Ensured the above changes maintain backwards compatibility with [existing passthrough column variables](https://github.com/fivetran/dbt_twitter?tab=readme-ov-file#passing-through-additional-metrics).
15
+
- Added a new [version](https://github.com/fivetran/dbt_twitter_ads/blob/main/macros/twitter_ads_persist_pass_through_columns.sql) of the `persist_pass_through_columns()`[macro](https://github.com/fivetran/dbt_fivetran_utils/blob/v0.4.10/macros/persist_pass_through_columns.sql) in which we can include coalesces and properly check between conversion field values and the existing passthrough columns.
16
+
- Added integrity and consistency validation tests within `integration_tests` for the Twitter Ads transformation models.
17
+
18
+
## Documentation
19
+
- Highlighted all metrics included in the package by default. Previously, `url_clicks` and `spend_micro` were missing from this README [section](https://github.com/fivetran/dbt_twitter?tab=readme-ov-file#passing-through-additional-metrics).
20
+
- Documented how to configure the new `twitter_ads__conversion_fields` and `twitter_ads__conversion_sale_amount_fields` variables [here](https://github.com/fivetran/dbt_twitter?tab=readme-ov-file#customizing-types-of-conversions).
21
+
- Added Contributors [subsection](https://github.com/fivetran/dbt_twitter?tab=readme-ov-file#contributors) to README.
Copy file name to clipboardExpand all lines: README.md
+48-6Lines changed: 48 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,15 +48,15 @@ dispatch:
48
48
search_order: ['spark_utils', 'dbt_utils']
49
49
```
50
50
51
-
### Step 2: Install the package
52
-
Include the following Twitter package version in your `packages.yml` file:
51
+
### Step 2: Install the package (skip if using `ad_reporting` combination package)
52
+
If you are not using the downstream [Ad Reporting](https://github.com/fivetran/dbt_ad_reporting) combination package, include the following Twitter package version in your `packages.yml` file:
53
53
> TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages
54
54
55
55
```yml
56
56
# packages.yml
57
57
packages:
58
58
- package: fivetran/twitter_ads
59
-
version: [">=0.7.0", "<0.8.0"] # we recommend using ranges to capture non-breaking changes automatically
59
+
version: [">=0.8.0", "<0.9.0"] # we recommend using ranges to capture non-breaking changes automatically
60
60
```
61
61
Do NOT include the `twitter_ads_source` package in this file. The transformation package itself has a dependency on it and will install the source package as well.
If you have multiple twitter ads connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the `source_relation` column of each model. To use this functionality, you will need to set either the `twitter_ads_union_schemas` OR `twitter_ads_union_databases` variables (cannot do both) in your root `dbt_project.yml` file:
84
86
@@ -91,8 +93,39 @@ vars:
91
93
92
94
To connect your multiple schema/database sources to the package models, follow the steps outlined in the [Union Data Defined Sources Configuration](https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source) section of the Fivetran Utils documentation for the union_data macro. This will ensure a proper configuration and correct visualization of connections in the DAG.
93
95
96
+
#### Customizing Types of Conversions
97
+
The package will include conversion metrics provided to the following variables in each model.
98
+
99
+
| Variable | Definition | Default Values |
100
+
| -------- | -------- | -------- |
101
+
| `twitter_ads__conversion_fields` | Which fields should be included in calculating total number of conversions. | `conversion_purchases_metric`, `conversion_custom_metric` |
102
+
| `twitter_ads__conversion_sale_amount_fields` | Which `*_sale_amount` fields should be included in calculating the total value of conversions. | `conversion_purchases_sale_amount`, `conversion_custom_sale_amount` |
103
+
104
+
In addition, the fields included in `var('twitter_ads__conversion_fields')` will be summed up into a `total_conversions` field, and the fields included in `var('twitter_ads__conversion_sale_amount_fields')` will be summed up into a `total_conversions_sale_amount` field.
105
+
106
+
By default, the data models include purchases and custom conversion events in both variables. However, you can configure each to include any types of conversions available in the Twitter Ads source `*_report` tables:
- <any conversion value/sale amount field you want to include>
123
+
```
124
+
125
+
> We recommend using the same *types* of conversion events for `twitter_ads__conversion_fields` and `twitter_ads__conversion_sale_amount_fields` so that `total_conversions` and `total_conversions_sale_amount` properly map onto each other, but this is not required. We chose to split conversions and conversion values into 2 distinct variables due to the N:1 relationship beteen conversions and conversion value fields.
126
+
94
127
#### Passing Through Additional Metrics
95
-
By default, this package will select `clicks`, `impressions`, and `cost` from the source reporting tables to store into the staging models. If you would like to pass through additional metrics to the staging models, add the below configurations to your `dbt_project.yml` file. These variables allow for the pass-through fields to be aliased (`alias`) if desired, but not required. Use the below format for declaring the respective pass-through variables:
128
+
Besides the above conversion fields, this package by default will select `clicks`, `url_clicks`, `impressions`, `spend` (calculated from `billed_charge_local_micro`), and `spend_micro` (aliased from `billed_charge_local_micro`) from the source reporting tables to store into the staging models. If you would like to pass through additional metrics to the staging models, add the below configurations to your `dbt_project.yml` file. These variables allow for the pass-through fields to be aliased (`alias`) if desired, but not required. Use the below format for declaring the respective pass-through variables:
96
129
97
130
> IMPORTANT: Make sure to exercise due diligence when adding metrics to these models. The metrics added by default (taps, impressions, and spend) have been vetted by the Fivetran team, maintaining this package for accuracy. There are metrics included within the source reports, such as metric averages, which may be inaccurately represented at the grain for reports created in this package. You must ensure that whichever metrics you pass through are appropriate to aggregate at the respective reporting levels in this package.
### (Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Core™
136
171
<details><summary>Expand for more details</summary>
137
172
<br>
@@ -146,8 +181,8 @@ This dbt package is dependent on the following dbt packages. These dependencies
146
181
147
182
```yml
148
183
packages:
149
-
- package: fivetran/twitter_source
150
-
version: [">=0.7.0", "<0.8.0"]
184
+
- package: fivetran/twitter_ads_source
185
+
version: [">=0.8.0", "<0.9.0"]
151
186
- package: fivetran/fivetran_utils
152
187
version: [">=0.4.0", "<0.5.0"]
153
188
- package: dbt-labs/dbt_utils
@@ -166,6 +201,13 @@ In creating this package, which is meant for a wide range of use cases, we had t
166
201
### Contributions
167
202
A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions.
168
203
204
+
We highly encourage and welcome contributions to this package. Check out [this dbt Discourse article](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) on the best workflow for contributing to a package.
205
+
206
+
#### Contributors
207
+
We thank [everyone](https://github.com/fivetran/dbt_twitter/graphs/contributors) who has taken the time to contribute. Each PR, bug report, and feature request has made this package better and is truly appreciated.
208
+
209
+
A special thank you to [Seer Interactive](https://www.seerinteractive.com/?utm_campaign=Fivetran%20%7C%20Models&utm_source=Fivetran&utm_medium=Fivetran%20Documentation), who we closely collaborated with to introduce native conversion support to our Ad packages.
210
+
169
211
## Are there any resources available?
170
212
- If you have questions or want to reach out for help, see the [GitHub Issue](https://github.com/fivetran/dbt_twitter/issues/new/choose) section to find the right avenue of support for you.
171
213
- If you would like to provide feedback to the dbt package team at Fivetran or would like to request a new dbt package, fill out our [Feedback Form](https://www.surveymonkey.com/r/DQ7K7WW).
0 commit comments