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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# dbt_facebook_ads_source version.version
# dbt_facebook_ads_source v0.8.1

## Bug Fixes
- Added logic to the `stg_facebook_ads__creative_history` model to dynamically convert the `url_tags` field from a JSON to a STRING if necessary (BigQuery only). This is necessary for the success of downstream transformations in the `facebook_ads` package. ([PR #43](https://github.com/fivetran/dbt_facebook_ads_source/pull/43))
> Note: If you are a BigQuery user unioning multiple Facebook Ads connections together in the package, the data type of `creative_history.url_tags` must be consistent across your connections. Otherwise, the `stg_facebook_ads__creative_history_tmp` will likely fail. Please reach out and create an issue if you are facing this error.

## Documentation
- Corrected references to connectors and connections in the README. ([#40](https://github.com/fivetran/dbt_facebook_ads_source/pull/40))
- Adjusted the header formatting in the README. ([PR #43](https://github.com/fivetran/dbt_facebook_ads_source/pull/43))
- Updated LICENSE. ([PR #43](https://github.com/fivetran/dbt_facebook_ads_source/pull/43))

# dbt_facebook_ads_source v0.8.0

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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<p align="center">
# Facebook Ads Source dbt Package ([Docs](https://fivetran.github.io/dbt_facebook_ads_source/))

<p align="left">
<a alt="License"
href="https://github.com/fivetran/dbt_facebook_ads_source/blob/main/LICENSE">
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" /></a>
Expand All @@ -13,7 +15,6 @@
<img src="https://img.shields.io/badge/Fivetran_Quickstart_Compatible%3F-yes-green.svg" /></a>
</p>

# Facebook Ads Source dbt Package ([Docs](https://fivetran.github.io/dbt_facebook_ads_source/))
## What does this dbt package do?
<!--section="facebook_ads_source_model"-->
- Materializes [Facebook Ads staging tables](https://fivetran.github.io/dbt_facebook_ads_source/#!/overview/facebook_ads_source/models/?g_v=1&g_e=seeds) which leverage data in the format described by [this ERD](https://fivetran.com/docs/applications/facebook-ads#schemainformation). These staging tables clean, test, and prepare your facebook_ads data from [Fivetran's connector](https://fivetran.com/docs/applications/facebook-ads) for analysis by doing the following:
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'facebook_ads_source'
version: '0.8.0'
version: '0.8.1'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
models:
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: 'facebook_ads_source_integration_tests_2'
version: '0.8.0'
version: '0.8.1'
profile: 'integration_tests'
config-version: 2

Expand Down
17 changes: 15 additions & 2 deletions models/stg_facebook_ads__creative_history.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ with base as (
from {{ ref('stg_facebook_ads__creative_history_tmp') }}
),

{%- set columns = adapter.get_columns_in_relation(ref('stg_facebook_ads__creative_history_tmp')) -%}
{%- set ns = namespace(url_tags_column_type='string') -%}

{% for column in columns %}
{%- if column.name|lower == 'url_tags' and target.type == 'bigquery' -%}
{%- set ns.url_tags_column_type = column.dtype|lower -%}
{%- endif -%}
{%- endfor %}

fields as (

select
{{
fivetran_utils.fill_staging_columns(
source_columns=adapter.get_columns_in_relation(ref('stg_facebook_ads__creative_history_tmp')),
source_columns=columns,
staging_columns=get_creative_history_columns()
)
}}
Expand All @@ -36,7 +45,11 @@ final as (
name as creative_name,
page_link,
template_page_link,
url_tags,
{% if ns.url_tags_column_type == 'json' and target.type == 'bigquery' -%}
TO_JSON_STRING(url_tags)
{%- else -%}
url_tags
{%- endif %} as url_tags,
asset_feed_spec_link_urls,
object_story_link_data_child_attachments,
object_story_link_data_caption,
Expand Down