Git Product home page Git Product logo

dbt_hubspot's Introduction

Hubspot

This package models Hubspot data from Fivetran's connector. It uses data in the format described by the marketing and sales ERDs.

This package enables you to better understand your Hubspot email and engagement performance. The output includes models for contacts, companies, and deals with enriched email and engagement metrics. It also includes analysis-ready event tables for email and engagement activities.

Models

This package contains transformation models, designed to work simultaneously with our Hubspot source package. A depenedency on the source package is declared in this package's packages.yml file, so it will automatically download when you run dbt deps. The primary outputs of this package are described below. Intermediate models are used to create these output models.

model description
hubspot__companies Each record represents a company in Hubspot, enriched with metrics about engagement activities.
hubspot__company_history Each record represents a change to a company in Hubspot, with valid_to and valid_from information.
hubspot__contacts Each record represents a contact in Hubspot, enriched with metrics about email and engagement activities.
hubspot__contact_history Each record represents a change to a contact in Hubspot, with valid_to and valid_from information.
hubspot__contact_lists Each record represents a contact list in Hubspot, enriched with metrics about email activities.
hubspot__deal Each record represents a deal in Hubspot, enriched with metrics about engagement activities.
hubspot__deal_history Each record represents a change to a deal in Hubspot, with valid_to and valid_from information.
hubspot__email_campaigns Each record represents a email campaign in Hubspot, enriched with metrics about email activities.
hubspot__email_event_* Each record represents an email event in Hubspot, joined with relevant tables to make them analysis-ready.
hubspot__email_sends Each record represents a sent email in Hubspot, enriched with metrics about opens, clicks, and other email activity.
hubspot__engagement_* Each record represents an engagement event in Hubspot, joined with relevant tables to make them analysis-ready.

Installation Instructions

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

Configuration

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

# dbt_project.yml

...
config-version: 2

vars:
  hubspot_source:
    hubspot_database: your_database_name
    hubspot_schema: your_schema_name 

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

Disabling models

When setting up your Hubspot connection in Fivetran, it is possible that not every table this package expects will be synced. This can occur because you either don't use that functionality in Hubspot or have actively decided to not sync some tables. In order to disable the relevant functionality in the package, you will need to add the relevant variables. By default, all variables are assumed to be true. You only need to add variables for the tables you would like to disable:

# dbt_project.yml

...
config-version: 2

vars:

  # Marketing

  hubspot_marketing_enabled: false                        # Disables all marketing models
  hubspot_contact_enabled: false                          # Disables the contact models
  hubspot_contact_list_enabled: false                     # Disables contact list models
  hubspot_contact_list_member_enabled: false              # Disables contact list member models
  hubspot_contact_property_enabled: false                 # Disables the contact property models
  hubspot_email_event_enabled: false                      # Disables all email_event models and functionality
  hubspot_email_event_bounce_enabled: false
  hubspot_email_event_click_enabled: false
  hubspot_email_event_deferred_enabled: false
  hubspot_email_event_delivered_enabled: false
  hubspot_email_event_dropped_enabled: false
  hubspot_email_event_forward_enabled: false
  hubspot_email_event_click_enabled: false
  hubspot_email_event_opens_enabled: false
  hubspot_email_event_print_enabled: false
  hubspot_email_event_sent_enabled: false
  hubspot_email_event_spam_report: false
  hubspot_email_event_status_change_enabled: false

  # Sales

  hubspot_sales_enabled: false                            # Disables all sales models
  hubspot_company_enabled: false
  hubspot_deal_enabled: false
  hubspot_engagement_enabled: false                       # Disables all engagement models and functionality
  hubspot_engagement_contact_enabled: false
  hubspot_engagement_company_enabled: false
  hubspot_engagement_deal_enabled: false
  hubspot_engagement_calls_enabled: false
  hubspot_engagement_emails_enabled: false
  hubspot_engagement_meetings_enabled: false
  hubspot_engagement_notes_enabled: false
  hubspot_engagement_tasks_enabled: false

Changing the Build Schema

By default this package will build the HubSpot staging models within a schema titled (<target_schema> + _stg_hubspot) and HubSpot final models within a schema titled (<target_schema> + hubspot) 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:
      +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

Contributions

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

Resources:

  • Find all of Fivetran's pre-built dbt packages in our dbt hub
  • Learn more about Fivetran here
  • Check out Fivetran's blog
  • Learn more about dbt in the docs
  • Check out Discourse for commonly asked questions and answers
  • Join the chat on Slack for live discussions and support
  • Find dbt events near you
  • Check out the blog for the latest news on dbt's development and best practices

dbt_hubspot's People

Contributors

dylanbaker avatar fivetran-chloe avatar fivetran-jamie avatar fivetran-joemarkiewicz avatar kristin-bagnall avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.