Skip to content

HousewareHQ/marketing_attribution_metrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marketing Attribution Metrics dbt Package (Docs)

📣 What does this dbt package do?

This package provides cross-functional metrics by combining Hubspot data from Fivetran's Hubspot connector and Segment data from Fivetran's Segment connector. It uses data in the format described by Hubspot ERD and Segment ERD.

This package enables you to attribute marketing campaigns to product events. The scope of this package is not just limited to product events, it can be transactions/subscriptions on Stripe and other activities tracked by SaaS tools.

Metrics

This package contains transformed models built on top of Houseware's Hubspot package and Houseware's Segment package. Dependencies on these packages have been declared in this package's packages.yml file, so it will automatically download when you run dbt deps. The metrics offered by this package are described below

metric description
weekly_email_to_product_events Weekly Email to Product Events.

|

🎯 How do I use the dbt package?

Step 1: Prerequisites

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

  • At least one Fivetran hubspot connector and one Fivetran segment connector syncing data into your destination.
  • A BigQuery, Snowflake, Redshift, or PostgreSQL destination.

Step 2: Install the package

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

Include in your packages.yml

packages:
  - git: "https://github.com/HousewareHQ/marketing_attribution_metrics.git"
    revision: v0.1.0

Step 3: Define database and schema variables

By default, this package will look for your Hubspot data in the fivetran_hubspot schema and Segment data in the fivetran_segment schema of your target database. If this is not where your data is, please add the following configuration to your dbt_project.yml file:

# dbt_project.yml

...
config-version: 2

vars:
  hubspot_source:
    hubspot_schema: my_new_schema_name
  
  segment_metrics:
    segment__schema: my_new_schema_name

For additional configurations for the Hubspot source models, please visit the Hubspot source package.

(Optional) Step 4: Change build schema

By default this package will build the Hubspot staging models within a schema titled (<target_schema> + _stg_hubspot) and the Hubspot metrics as well as Segment metrics within <target_schema> in your target database. If this is not where you would like your modeled Hubspot data to be written to, add the following configuration to your dbt_project.yml file:

# dbt_project.yml

...
models:
  hubspot_metrics:
    +schema: my_new_schema_name # leave blank for just the target_schema
  hubspot_source:
    +schema: my_new_schema_name # leave blank for just the target_schema
  segment_metrics:
    +schema: my_new_schema_name # leave blank for just the target_schema

(Optional) Step 5: Override package variables

vars:
  marketing_attribution_metrics:
    hubspot_email_event_filter__in: "('OPEN', 'CLICK')" # add more hubspot events here, if needed
    hubspot_event_to_segment_event_time_interval: hour # change this to any `datediff` interval (hour, day, year, etc)
    hubspot_event_to_segment_event_time_value: 2 # interval value between segment events and hubspot events 

🗄 Which warehouses are supported?

This package has been tested on Snowflake.

🙌 Can I contribute?

Additional contributions to this package are very welcome! Please create issues or open PRs against main. Check out this post on the best workflow for contributing to a package.

🏪 Are there any resources available?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •