Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add conversions #43

Merged
merged 46 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b95c3d9
working locally
fivetran-jamie May 21, 2024
bbea210
document
fivetran-jamie May 21, 2024
67d9c0b
docs
fivetran-jamie May 21, 2024
b7fe4d1
cleanup
fivetran-jamie May 21, 2024
95f3ec6
coalesces
fivetran-jamie May 21, 2024
d864c93
docs
fivetran-jamie May 21, 2024
cedacf8
tests passing
fivetran-jamie May 21, 2024
2ded6de
revert local stuff
fivetran-jamie May 21, 2024
bb28474
buildkite
fivetran-jamie May 21, 2024
ff24d9e
bk
fivetran-jamie May 21, 2024
a7a82f3
empty var work
fivetran-jamie May 22, 2024
c01bda4
whitespace
fivetran-jamie May 22, 2024
fffe659
Update integration_tests/dbt_project.yml
fivetran-jamie May 23, 2024
64006dc
Update CHANGELOG.md
fivetran-jamie May 23, 2024
33c4fc4
use macro
fivetran-jamie May 23, 2024
7ccbf4a
more docs and remove second reviewer bot
fivetran-jamie May 23, 2024
c00cc87
docs
fivetran-jamie May 23, 2024
593b180
update readme model docs
fivetran-jamie Jul 5, 2024
b72d867
Merge branch 'main' into feature/add-conversions
fivetran-jamie Sep 11, 2024
76d055c
pivot all conversion fields into individual ones
fivetran-jamie Oct 14, 2024
7ec6786
bk
fivetran-jamie Oct 28, 2024
5044dbf
work
fivetran-jamie Oct 29, 2024
a3ecb3c
Revert pivoting
fivetran-jamie Oct 30, 2024
21776dc
tests are working
fivetran-jamie Oct 30, 2024
ca2387c
tests
fivetran-jamie Oct 30, 2024
dd326d4
bk
fivetran-jamie Oct 30, 2024
72e21fa
Merge branch 'main' into feature/add-conversions
fivetran-jamie Oct 30, 2024
8994c35
bk testing
fivetran-jamie Nov 5, 2024
42ffa65
fix
fivetran-jamie Nov 5, 2024
a9b6c1d
make seed file uniquw
fivetran-jamie Nov 5, 2024
5850ac6
document stuff
fivetran-jamie Nov 5, 2024
e5b74f3
remove commented out code and polish things
fivetran-jamie Nov 5, 2024
3ede410
polishes
fivetran-jamie Nov 5, 2024
78e3f65
joe feedback
fivetran-jamie Nov 6, 2024
23aaa7e
backwards compatible
fivetran-jamie Nov 7, 2024
96c732d
docs
fivetran-jamie Nov 7, 2024
11d9074
regen docs and adjust seeds to produce output
fivetran-jamie Nov 12, 2024
6402d52
Update README.md
fivetran-jamie Nov 12, 2024
b26afc7
renee feedback
fivetran-jamie Nov 13, 2024
a5f7109
bk mistake
fivetran-jamie Nov 13, 2024
1a15cff
bk
fivetran-jamie Nov 13, 2024
b5b9dc2
bk working
fivetran-jamie Nov 13, 2024
d499390
bk
fivetran-jamie Nov 13, 2024
7b3e171
bk
fivetran-jamie Nov 13, 2024
ed63e94
docs
fivetran-jamie Nov 13, 2024
a790467
source package ref
fivetran-jamie Nov 14, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Please share any and all of your validation steps:

### If you had to summarize this PR in an emoji, which would it be?
<!--- For a complete list of markdown compatible emojis check our this git repo (https://gist.github.com/rxaviers/7360908) -->
:dancer:
:dancer:
48 changes: 46 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,51 @@
# dbt_facebook_ads v0.NEXT.RELEASE
# dbt_facebook_ads v0.8.0

## Feature Updates: Conversion Metrics
[PR #43](https://github.com/fivetran/dbt_facebook_ads/pull/43) includes the following updates:
- Adds a `conversions` and `conversions_value` field to each `_report` end model, representing the raw and monetary value of conversions, respectively, that occurred on each day for each ad/campaign/ad set/url/account. These will aggregate conversions of all included `action_types`.
- By default, the package will consider purchase, lead, and custom-defined events to be conversions based on the record's `action_type` (see below):

| Action Type | Action Description ([Meta docs](https://developers.facebook.com/docs/marketing-api/reference/ads-action-stats/)) |
| -------- | ------- |
| `offsite_conversion.fb_pixel_custom` | Custom pixel events defined by the advertiser. This will group together individual `offsite_conversion.custom%` custom conversion events. |
| `offsite_conversion.fb_pixel_lead` | The number of "lead" events tracked by the pixel or Conversions API on your website and attributed to your ads. Off-Facebook leads, in short. |
| `onsite_conversion.lead_grouped` | The number of leads submitted on Meta technologies (including forms and Messenger) and attributed to your ads. On-Facebook leads, in short. |
| `offsite_conversion.fb_pixel_purchase` | The number of "purchase" events tracked by the pixel or Conversions API on your website and attributed to your ads. Off-Facebook purchases, in short. |
| `onsite_conversion.purchase` | The number of purchases made within Meta technologies (such as Pages or Messenger) and attributed to your ads. On-Facebook purchases, in short. |

- The above can be configured via the the new `facebook_ads__conversion_action_types` variable. See [README](https://github.com/fivetran/dbt_facebook_ads/tree/main?tab=readme-ov-file#configuring-conversion-action-types) for more details.
```yml
# dbt_project.yml
vars:
facebook_ads__conversion_action_types: # case-insensitive
- name: exact_conversion_action_type_name # will grab `basic_ad_actions` records where action_type = 'exact_conversion_action_type_name'
- pattern: onsite_conversion% # will grab all `onsite_conversion%` records
- name: offsite_conversion.custom.my_custom_conversion_123
- name: very_specific_conversion_action
where_sql: source_relation = 'specific advertiser source' # will grab `basic_ad_actions` records where (action_type = very_specific_conversion_action and {{ where_sql }})
- pattern: subscribe%
where_sql: source_relation = 'advertiser who only cares about subscriptions' # will grab `basic_ad_actions` records where (action_type like 'subscribe%' and {{ where_sql }})
```

>**Note**: If you were previously utilizing the `facebook_ads__basic_ad_passthrough_metrics` variable to include a (likely null) field called `conversions` or `conversions_value`, the package's version of these fields will take precedence over yours. To continue including your old conversions fields, change the `alias` of the passthrough field to another name.

- Creates the new `facebook_ads__basic_ad_actions_passthrough_metrics` and `facebook_ads__basic_ad_action_values_passthrough_metrics` variables to pass through additional conversion value metrics that are calculated using different attribution windows.
- By default, the package includes only the conversion values calculated using the default attribution window set in Meta, but your report may include calculations using the other windows defined [here](https://developers.facebook.com/docs/marketing-api/reference/ads-action-stats/). See [README](https://github.com/fivetran/dbt_facebook_ads/tree/main?tab=readme-ov-file#passing-through-additional-metrics) for details on how to use the new variables.
fivetran-reneeli marked this conversation as resolved.
Show resolved Hide resolved
- Adds `optimization_goal` field to `facebook_ads__ad_set_report` model. This is defined as the optimization goal this ad set is using, possible values of which are defined [here](https://developers.facebook.com/docs/marketing-api/reference/ad-campaign/#fields).
- Adds `conversion_domain` field to `facebook_ads__ad_report` model. This is defined as the domain you've configured the ad to convert to.

## Documentation
- Documents the ability to transform metrics provided to the `facebook_ads__basic_ad_passthrough_metrics` and `facebook_ads__basic_ad_action_values_passthrough_metrics` variables. See [README](https://github.com/fivetran/dbt_facebook_ads/tree/main?tab=readme-ov-file#passing-through-additional-metrics) for details ([PR #43](https://github.com/fivetran/dbt_facebook_ads/pull/43)).
- Added missing documentation for fields in the campaign, ad set, and account report models ([PR #43](https://github.com/fivetran/dbt_facebook_ads/pull/43)).

## Under the Hood
- Updated the `quickstart.yml` file to allow for automated Quickstart data model deployments. ([PR #40](https://github.com/fivetran/dbt_facebook_ads/pull/40))
- Updated the `quickstart.yml` file to allow for automated Quickstart data model deployments ([PR #40](https://github.com/fivetran/dbt_facebook_ads/pull/40)).
- Updated the PR templates to align with our most up-to-date standards ([PR #43](https://github.com/fivetran/dbt_facebook_ads/pull/43)).
fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved
- Removed the now-defunct 2nd reviewer bot workflow ([PR #43](https://github.com/fivetran/dbt_facebook_ads/pull/43)).
- Added a new [version](https://github.com/fivetran/dbt_facebook_ads/blob/main/macros/facebook_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` ([PR #43](https://github.com/fivetran/dbt_facebook_ads/pull/43)).

## Contributors
- [Seer Interactive](https://www.seerinteractive.com/?utm_campaign=Fivetran%20%7C%20Models&utm_source=Fivetran&utm_medium=Fivetran%20Documentation)

# dbt_facebook_ads v0.7.2

Expand Down
Loading