Skip to content

Repository files navigation

MNTN dbt Package

This dbt package transforms data from Fivetran's MNTN connector into analytics-ready tables.

Resources

What does this dbt package do?

This package enables you to better understand the performance of your MNTN connected TV and streaming ads across varying grains and produces modeled tables that leverage MNTN data. It creates enriched models with metrics focused on account, campaign, ad group, ad, geographic (country/state), destination URL, and audience-segment reporting.

Output schema

Final output tables are generated in the following target schema:

<your_database>.<connector/schema_name>_mntn

Final output tables

By default, this package materializes the following final tables:

Table Description
mntn__account_report Daily account-level performance, including impressions, visits, spend, and conversions.

Example Analytics Questions:
  • How does performance compare across different MNTN accounts?
  • Is spend trending up or down over time at the account level?
mntn__campaign_report Daily campaign-level performance, sourced from MNTN's campaign_group table (the platform's preferred campaign-level reporting grain).

Example Analytics Questions:
  • Which campaigns are most efficient in terms of cost per conversion?
  • Which campaigns contribute most to overall spend or conversions?
mntn__ad_group_report Daily ad-group-level performance, sourced from MNTN's creative_group table (one TV commercial plus its tracking).

Example Analytics Questions:
  • Which ad groups have the strongest engagement relative to spend?
  • Do certain ad groups dominate impressions within a campaign?
mntn__ad_report Daily ad-level performance, sourced from MNTN's creative table (the platform's most granular metrics grain), enriched with ad activation status and ad-serving tag attributes.

Example Analytics Questions:
  • Which ad creatives are driving the lowest cost per conversion?
  • How do performance trends change after refreshing creative?
mntn__country_report Daily performance broken out by country.

Example Analytics Questions:
  • Which countries are delivering the highest return on ad spend?
  • Are there seasonal performance variations by geographic region?
mntn__region_report Daily performance broken out by state/province.

Example Analytics Questions:
  • Which states are driving the most efficient performance?
  • How do regional performance trends correlate with local market conditions?
mntn__url_report Daily performance broken out by destination URL, parsed from creative_info.click_url. By default, excludes ads with NULL click_url values.

Example Analytics Questions:
  • Which landing pages are driving the highest conversion rates?
  • Which UTM campaigns are driving the most traffic across different creatives?
mntn__segment_report Daily audience/targeting-segment performance, MNTN's audience concept with no equivalent report type in other ad_reporting platforms.

Example Analytics Questions:
  • Which audience segments are driving the most site visits?
  • How does new vs. existing audience reach vary by segment?

¹ Each Quickstart transformation job run materializes these models if all components of this data model are enabled. This count includes all staging and final models materialized as view or table.


Prerequisites

To use this dbt package, you must have the following:

  • At least one Fivetran MNTN connection syncing data into your destination.
  • A BigQuery, Snowflake, Redshift, PostgreSQL, or Databricks destination.
  • The advertiser and advertiser_info source tables syncing, which power mntn__account_report. Note that account-level context (account_id/account_name) is not enriched into the other end models, since MNTN's other source tables carry no advertiser identifier of their own and a single MNTN connection can span multiple advertiser accounts.
  • Note that creative_group, campaign_info, creative, creative_info, ad_info, analytics_by_country, and analytics_by_state are optional source tables. If any of these are not syncing for your MNTN connection, the corresponding report(s) are disabled by default — see Enable or Disable Optional Reports below.

How do I use the dbt package?

You can either add this dbt package in the Fivetran dashboard or import it into your dbt project:

  • To add the package in the Fivetran dashboard, follow our Quickstart guide.
  • To add the package to your dbt project, follow the setup instructions in the dbt package's README file to use this package.

Install the package

Include the following mntn package version in your packages.yml file:

TIP: Check dbt Hub for the latest installation instructions or read the dbt docs for more information on installing packages.

packages:
  - package: fivetran/mntn
    version: [">=0.1.0", "<0.2.0"] # we recommend using ranges to capture non-breaking changes automatically

Databricks Dispatch Configuration

If you are using a Databricks destination with this package, add the below (or a variation of the below) dispatch configuration within your dbt_project.yml. This is required in order for the package to accurately search for macros within the dbt-labs/spark_utils then the dbt-labs/dbt_utils packages respectively.

dispatch:
  - macro_namespace: dbt_utils
    search_order: ['spark_utils', 'dbt_utils']

Define database and schema variables

By default, this package runs using your destination and the mntn schema. If this is not where your MNTN data is (for example, if your MNTN schema is named mntn_fivetran), add the following configuration to your root dbt_project.yml file:

vars:
    mntn_database: your_destination_name
    mntn_schema: your_schema_name

(Optional) Additional configurations

Expand/Collapse details

Union multiple connections

If you have multiple MNTN connections in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. For each source table, the package will union all of the data together and pass the unioned table into the transformations. The source_relation column in each model indicates the origin of each record.

To use this functionality, set the mntn_sources variable in your root dbt_project.yml file:

# dbt_project.yml

vars:
  mntn_sources:
    - database: connection_1_destination_name # Required
      schema: connection_1_schema_name # Required
      name: connection_1_source_name # Required only if incorporating unioned sources into your DAG

    - database: connection_2_destination_name
      schema: connection_2_schema_name
      name: connection_2_source_name

NOTE: The native src_mntn.yml connection set up in the package will not function when the union feature is utilized. Although the data will be correctly combined, you will not observe the sources linked to the package models in the Directed Acyclic Graph (DAG). This happens because the package includes only one defined src_mntn.yml.

To connect your multiple schema/database sources to the package models, follow the steps outlined in the Union Data Defined Sources Configuration section of the Fivetran Utils documentation for the union_connections macro. This will ensure a proper configuration and correct visualization of connections in the DAG.

Enable or Disable Optional Reports

This package uses several optional source tables that not every MNTN account may sync. If you are running this package via Fivetran Quickstart, transformations of the below tables are dynamically enabled or disabled. Otherwise, all are enabled by default.

To disable transformations of any of the below tables and their corresponding report(s), add the relevant variable configuration(s) to your root dbt_project.yml file:

vars:
  mntn__using_creative_group: false     # True by default. Enables/disables use of the `creative_group` table and the `mntn__ad_group_report` model.
  mntn__using_campaign_info: false      # True by default. Enables/disables use of the `campaign_info` table.
  mntn__using_creative: false           # True by default. Enables/disables use of the `creative` table and the `mntn__ad_report`/`mntn__url_report` models.
  mntn__using_creative_info: false      # True by default. Enables/disables use of the `creative_info` table and the `mntn__url_report` model.
  mntn__using_ad_info: false            # True by default. Enables/disables use of the `ad_info` table.
  mntn__using_analytics_by_country: false # True by default. Enables/disables use of the `analytics_by_country` table and the `mntn__country_report` model.
  mntn__using_analytics_by_state: false   # True by default. Enables/disables use of the `analytics_by_state` table and the `mntn__region_report` model.

Passing Through Additional Metrics

By default, this package selects impressions, visits, spend, conversions, and conversions_value (where available) from the source reporting tables to store into the output models. If you would like to pass through additional metrics, add the below configurations to your dbt_project.yml file. These variables allow for the pass-through fields to be aliased (alias) and transformed (transform_sql) if desired, but not required. Only the name of each metric field is required. Use the below format for declaring the respective pass-through variables:

Note: Please ensure you exercise due diligence when adding metrics to these models. Passthrough metrics are only available at the source-table grain (account, campaign, ad group, ad, country, region, segment). Only pass through additive measures (e.g. counts, spend) — metrics that are already aggregations at a finer grain, such as rates or ratios, should not be summed when rolled up into a coarser report grain.

vars:
    mntn__account_passthrough_metrics: # add metrics found in ADVERTISER
      - name: "new_custom_field"
        alias: "custom_field_alias"
        transform_sql: "coalesce(custom_field_alias, 0)" # reference the `alias` here if you are using one (otherwise the `name`)
    mntn__campaign_passthrough_metrics: # add metrics found in CAMPAIGN_GROUP
      - name: "another_one"
    mntn__ad_group_passthrough_metrics: # add metrics found in CREATIVE_GROUP
      - name: "another_one"
    mntn__ad_passthrough_metrics: # add metrics found in CREATIVE
      - name: "another_one"
    mntn__country_passthrough_metrics: # add metrics found in ANALYTICS_BY_COUNTRY
      - name: "another_one"
    mntn__region_passthrough_metrics: # add metrics found in ANALYTICS_BY_STATE
      - name: "another_one"
    mntn__segment_passthrough_metrics: # add metrics found in SEGMENT
      - name: "site_visitor"
        alias: "site_visitors"

Note: A small number of segment source columns added by MNTN in June 2026 (site_visitor, existing_site_visitor, new_site_visitor, existing_user_reached, new_user_reached) are singular, breaking from the plural convention (*_visitors, *_reached) used everywhere else in this package. To opt into these specific columns while keeping the plural naming convention, provide an alias as shown above.

Change the source table references

If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable. This is not available when running the package on multiple unioned connections.

IMPORTANT: See this project's models/staging/src_mntn.yml source declarations to see the expected names.

vars:
    mntn_<default_source_table_name>_identifier: your_table_name

(Optional) Orchestrate your models with Fivetran Transformations for dbt Core™

Expand for more details

Fivetran offers the ability for you to orchestrate your dbt project through Fivetran Transformations for dbt Core™. Learn how to set up your project for orchestration through Fivetran in our Transformations for dbt Core setup guides.

Does this package have dependencies?

This dbt package is dependent on the following dbt packages. These dependencies are installed by default within this package. For more information on the following packages, refer to the dbt hub site.

IMPORTANT: If you have any of these dependent packages in your own packages.yml file, we highly recommend that you remove them from your root packages.yml to avoid package version conflicts.

packages:
    - package: fivetran/fivetran_utils
      version: [">=0.4.0", "<0.5.0"]

    - package: dbt-labs/dbt_utils
      version: [">=1.0.0", "<2.0.0"]

    - package: dbt-labs/spark_utils
      version: [">=0.3.0", "<0.4.0"]

How is this package maintained and can I contribute?

Package Maintenance

The Fivetran team maintaining this package only maintains the latest version of the package. We highly recommend you stay consistent with the latest version of the package and refer to the CHANGELOG and release notes for more information on changes across versions.

Contributions

A small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions.

We highly encourage and welcome contributions to this package. Learn how to contribute to a package in dbt's Contributing to an external dbt package article.

Contributors

We thank everyone who has taken the time to contribute. Each PR, bug report, and feature request has made this package better and is truly appreciated.

Are there any resources available?

  • If you have questions or want to reach out for help, see the GitHub Issue section to find the right avenue of support for you.
  • 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.

Releases

Packages

Contributors