{"id":22793329,"url":"https://github.com/fivetran/dbt_hubspot","last_synced_at":"2026-01-16T21:33:24.887Z","repository":{"id":37858694,"uuid":"270778238","full_name":"fivetran/dbt_hubspot","owner":"fivetran","description":"Data models for Hubspot built using dbt.","archived":false,"fork":false,"pushed_at":"2025-08-14T05:48:50.000Z","size":7517,"stargazers_count":36,"open_issues_count":9,"forks_count":42,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-08-14T07:24:22.427Z","etag":null,"topics":["dbt","dbt-packages","fivetran","hubspot"],"latest_commit_sha":null,"homepage":"https://fivetran.github.io/dbt_hubspot/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fivetran.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-08T18:21:17.000Z","updated_at":"2025-08-11T08:02:35.000Z","dependencies_parsed_at":"2023-10-25T20:35:51.745Z","dependency_job_id":"09efb380-f77e-4ecc-90a8-dbb749ca471f","html_url":"https://github.com/fivetran/dbt_hubspot","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/fivetran/dbt_hubspot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_hubspot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_hubspot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_hubspot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_hubspot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fivetran","download_url":"https://codeload.github.com/fivetran/dbt_hubspot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Fdbt_hubspot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273053566,"owners_count":25037432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbt","dbt-packages","fivetran","hubspot"],"created_at":"2024-12-12T03:19:14.775Z","updated_at":"2026-01-16T21:33:24.878Z","avatar_url":"https://github.com/fivetran.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--section=\"hubspot_transformation_model\"--\u003e\n# Hubspot dbt Package\n\n\u003cp align=\"left\"\u003e\n    \u003ca alt=\"License\"\n        href=\"https://github.com/fivetran/dbt_hubspot/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" /\u003e\u003c/a\u003e\n    \u003ca alt=\"dbt-core\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/dbt_Core™_version-\u003e=1.3.0,_\u003c3.0.0-orange.svg\" /\u003e\u003c/a\u003e\n    \u003ca alt=\"Maintained?\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" /\u003e\u003c/a\u003e\n    \u003ca alt=\"PRs\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Contributions-welcome-blueviolet\" /\u003e\u003c/a\u003e\n    \u003ca alt=\"Fivetran Quickstart Compatible\"\n        href=\"https://fivetran.com/docs/transformations/data-models/quickstart-management#quickstartmanagement\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Fivetran_Quickstart_Compatible%3F-yes-green.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis dbt package transforms data from Fivetran's Hubspot connector into analytics-ready tables.\n\n## Resources\n\n- Number of materialized models¹: 147\n- Connector documentation\n  - [Hubspot connector documentation](https://fivetran.com/docs/connectors/applications/hubspot)\n  - [Hubspot ERD](https://fivetran.com/docs/connectors/applications/hubspot#schemainformation)\n- dbt package documentation\n  - [GitHub repository](https://github.com/fivetran/dbt_hubspot)\n  - [dbt Docs](https://fivetran.github.io/dbt_hubspot/#!/overview)\n  - [DAG](https://fivetran.github.io/dbt_hubspot/#!/overview?g_v=1)\n  - [Changelog](https://github.com/fivetran/dbt_hubspot/blob/main/CHANGELOG.md)\n\n## What does this dbt package do?\nThis package enables you to better understand your HubSpot email and engagement performance and generates comprehensive data dictionaries. It creates enriched models with metrics focused on contacts, companies, deals, and analysis-ready event tables for email and engagement activities.\n\n### Output schema\nFinal output tables are generated in the following target schema:\n\n```\n\u003cyour_database\u003e.\u003cconnector/schema_name\u003e_hubspot\n```\n\n### Final output tables\n\nBy default, this package materializes the following final tables:\n\n| Table | Description |\n| :---- | :---- |\n| [hubspot__companies](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__companies) | Each record represents a company in Hubspot, enriched with metrics about engagement activities.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhich companies receive many emails but send few replies?\u003c/li\u003e\u003cli\u003eWhich industries or regions have the most engaged companies?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__company_history](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__company_history) | Each record represents a change to a company in Hubspot, with `valid_to` and `valid_from` information.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhich companies change owners or lifecycle stages most often?\u003c/li\u003e\u003cli\u003eHow long after updating company details do deals typically get created?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__contacts](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__contacts) | Each record represents a contact in Hubspot, enriched with metrics about email and engagement activities.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhich job titles have the highest email open and click rates?\u003c/li\u003e\u003cli\u003eDo contacts prefer calls and meetings or email?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__contact_history](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__contact_history) | Each record represents a change to a contact in Hubspot, with `valid_to` and `valid_from` information.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhat is the typical progression timeline of contact lifecycle stage changes from \"lead\" to \"customer\"?\u003c/li\u003e\u003cli\u003eWhat proportion of contacts revert to earlier lifecycle stages?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__contact_lists](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__contact_lists) | Each record represents a contact list in Hubspot, enriched with metrics about email activities.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhich contact lists have the highest click-to-open ratios and lowest unsubscribe rates?\u003c/li\u003e\u003cli\u003eWhich contact lists show high bounce rates or low delivery rates?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__deals](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__deals) | Each record represents a deal in Hubspot, enriched with metrics about engagement activities.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eHow do won deals differ from lost deals in engagement activity?\u003c/li\u003e\u003cli\u003eWhich high-value deals have low engagement and may be at risk?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__deal_stages](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__deal_stages) | Each record represents when a deal stage changes in Hubspot, with stage entry/exit dates and pipeline metadata.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhich pipeline stages have the highest drop-off rates?\u003c/li\u003e\u003cli\u003eWhich deals are currently in stages longer than the historical average, indicating stalled opportunities?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__deal_history](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__deal_history) | Each record represents a change to a deal in Hubspot, with `valid_to` and `valid_from` information.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eHow do deal amounts fluctuate throughout the sales cycle?\u003c/li\u003e\u003cli\u003eWhich deals have experienced frequent ownership transfers or reassignments, possibly slowing progress?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__tickets](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__tickets) | Each record represents a ticket in Hubspot, enriched with metrics about engagement activities and information on associated deals, contacts, companies, and owners.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhich currently open tickets are linked to high-value customers or companies and should be prioritized?\u003c/li\u003e\u003cli\u003eWhich customers generate the highest support volume relative to their deal size or lifetime value?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__daily_ticket_history](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__daily_ticket_history) | Each record represents a ticket's day in Hubspot with tracked properties pivoted out into columns.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eHow long did tickets spend in each pipeline stage on average last quarter?\u003c/li\u003e\u003cli\u003eWhat is the distribution of ticket ages by priority level and pipeline stage?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__email_campaigns](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__email_campaigns) | Each record represents a email campaign in Hubspot, enriched with metrics about email activities.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhat is the click-to-open ratio by campaign type (newsletter vs. promotional vs. nurture)?\u003c/li\u003e\u003cli\u003eWhat is the relationship between a campaign's number of messages and recipient engagement?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__email_event_*](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__email_event_bounce) | Each record represents an email event in Hubspot, joined with relevant tables to make them analysis-ready.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eHow do spam reports vary by sender domain or audience source?\u003c/li\u003e\u003cli\u003eWhich links or CTAs receive the most clicks?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__email_sends](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__email_sends) | Each record represents a sent email in Hubspot, enriched with metrics about opens, clicks, and other email activity.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhich recipient domains have the highest bounce rates?\u003c/li\u003e\u003cli\u003eWhat are the optimal send timing patterns based on open and click performance across different contact segments?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__engagements](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__engagements) | Each record represents an engagement in Hubspot, enriched with contact, company, and deal information.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhich sales reps log the highest number of engagements overall, and what is their activity mix (calls vs. emails vs. meetings)?\u003c/li\u003e\u003cli\u003eWhat is the average time between customer-initiated engagement (e.g., inbound email) and follow-up activity from reps?\u003c/li\u003e\u003c/ul\u003e |\n| [hubspot__engagement_*](https://fivetran.github.io/dbt_hubspot/#!/model/model.hubspot.hubspot__engagement_calls) | Each record represents an engagement event in Hubspot, joined with relevant tables to make them analysis-ready.\u003cbr\u003e\u003cbr\u003e**Example Analytics Questions:**\u003cbr\u003e\u003cul\u003e\u003cli\u003eWhat are the busiest call days and times for successful connections?\u003c/li\u003e\u003cli\u003eWhich reps consistently schedule follow-up meetings after initial contact?\u003c/li\u003e\u003c/ul\u003e |\n\n¹ Each Quickstart transformation job run materializes these models if all components of this data model are enabled. This count includes all staging, intermediate, and final models materialized as `view`, `table`, or `incremental`.\n\n---\n\n## Prerequisites\nTo use this dbt package, you must have the following:\n\n- At least one Fivetran HubSpot connection syncing data into your destination.\n- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, or **Databricks** destination.\n\n## How do I use the dbt package?\nYou can either add this dbt package in the Fivetran dashboard or import it into your dbt project:\n\n- To add the package in the Fivetran dashboard, follow our [Quickstart guide](https://fivetran.com/docs/transformations/data-models/quickstart-management).\n- To add the package to your dbt project, follow the setup instructions in the dbt package's [README file](https://github.com/fivetran/dbt_hubspot/blob/main/README.md#how-do-i-use-the-dbt-package) to use this package.\n\n\u003c!--section-end--\u003e\n\n### Install the package\nInclude the following hubspot package version in your `packages.yml` file:\n\u003e TIP: Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages.\n```yaml\npackages:\n  - package: fivetran/hubspot\n    version: [\"\u003e=1.6.0\", \"\u003c1.7.0\"] # we recommend using ranges to capture non-breaking changes automatically\n```\n\u003e All required sources and staging models are now bundled into this transformation package. Do not include `fivetran/hubspot_source` in your `packages.yml` since this package has been deprecated.\n\n#### Database Incremental Strategies\nMany of the models in this package are materialized incrementally, so we have configured our models to work with the different strategies available to each supported warehouse.\n\nFor **BigQuery** and **Databricks All Purpose Cluster runtime** destinations, we have chosen `insert_overwrite` as the default strategy, which benefits from the partitioning capability.\n\u003e For Databricks SQL Warehouse destinations, models are materialized as tables without support for incremental runs.\n\nFor **Snowflake**, **Redshift**, and **Postgres** databases, we have chosen `delete+insert` as the default strategy.\n\n\u003e Regardless of strategy, we recommend that users periodically run a `--full-refresh` to ensure a high level of data quality.\n\n#### Databricks dispatch configuration\nIf you are using a Databricks destination with this package, you must add the following (or a variation of the following) 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.\n```yml\ndispatch:\n  - macro_namespace: dbt_utils\n    search_order: ['spark_utils', 'dbt_utils']\n```\n\n### Define database and schema variables\n\n#### Option A: Single connection\nBy default, this package runs using your [destination](https://docs.getdbt.com/docs/running-a-dbt-project/using-the-command-line-interface/configure-your-profile) and the `hubspot` schema. If this is not where your hubspot data is (for example, if your hubspot schema is named `hubspot_fivetran`), add the following configuration to your root `dbt_project.yml` file:\n\n```yml\nvars:\n    hubspot:\n        hubspot_database: your_database_name\n        hubspot_schema: your_schema_name\n```\n\n#### Option B: Union multiple connections\nIf you have multiple hubspot 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.\n\nTo use this functionality, you will need to set the `hubspot_sources` variable in your root `dbt_project.yml` file:\n\n```yml\n# dbt_project.yml\n\nvars:\n    hubspot:\n        hubspot_sources:\n        - database: connection_1_destination_name # Required\n          schema: connection_1_schema_name # Required\n          name: connection_1_source_name # Required only if following the step in the following subsection\n\n        - database: connection_2_destination_name\n          schema: connection_2_schema_name\n          name: connection_2_source_name\n```\n\n##### Recommended: Incorporate unioned sources into DAG\n\u003e *If you are running the package through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt#transformationsfordbtcore), the below step is necessary in order to synchronize model runs with your hubspot connections. Alternatively, you may choose to run the package through Fivetran [Quickstart](https://fivetran.com/docs/transformations/quickstart), which would create separate sets of models for each hubspot source rather than one set of unioned models.*\n\nBy default, this package defines one single-connection source, called `hubspot`, which will be disabled if you are unioning multiple connections. This means that your DAG will not include your hubspot sources, though the package will run successfully.\n\nTo properly incorporate all of your hubspot connections into your project's DAG:\n1. Define each of your sources in a `.yml` file in your project. Utilize the following template for the `source`-level configurations, and, **most importantly**, copy and paste the table and column-level definitions from the package's `src_hubspot.yml` [file](https://github.com/fivetran/dbt_hubspot/blob/main/models/staging/src_hubspot.yml).\n\n```yml\n# a .yml file in your root project\n\nversion: 2\n\nsources:\n- name: \u003cname\u003e # ex: Should match name in hubspot_sources\n  schema: \u003cschema_name\u003e\n  database: \u003cdatabase_name\u003e\n  loader: fivetran\n  config:\n    loaded_at_field: _fivetran_synced\n    freshness: # feel free to adjust to your liking\n      warn_after: {count: 72, period: hour}\n      error_after: {count: 168, period: hour}\n\n  tables: # copy and paste from hubspot/models/staging/src_hubspot.yml - see https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/ for how to use anchors to only do so once\n```\n\n\u003e **Note**: If there are source tables you do not have (see [Disable/enable models and sources](https://github.com/fivetran/dbt_hubspot?tab=readme-ov-file#disableenable-models-and-sources)), you may still include them, as long as you have set the right variables to `False`.\n\n2. Set the `has_defined_sources` variable (scoped to the `hubspot` package) to `True`, like such:\n```yml\n# dbt_project.yml\nvars:\n    hubspot:\n        has_defined_sources: true\n```\n\n### Disable/enable models and sources\nWhen 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. Therefore we have added enable/disable configs in the `src.yml` to allow you to disable certain sources not present. Downstream models are automatically disabled as well. In order to disable the relevant functionality in the package, you will need to add the relevant variables in your root `dbt_project.yml`. \n\nBy default, all variables are assumed to be `true`, **with the exception of the below**. These default to `false` and must be explicitly enabled if needed:\n\n- `hubspot_service_enabled`\n- `hubspot_ticket_deal_enabled`\n- `hubspot_contact_merge_audit_enabled`\n- `hubspot_merged_deal_enabled`\n- `hubspot_engagement_communication_enabled`\n\nYou only need to add variables for the sources that differ from their defaults. To do so, add the relevant variable configuration from below to your `dbt_project.yml`:\n\n```yml\nvars:\n  # Marketing\n\n  hubspot_marketing_enabled: false                        # Disables all marketing models\n  hubspot_contact_enabled: false                          # Disables the contact models\n  hubspot_contact_form_enabled: false                     # Disables form and contact form submission data and its relationship to contacts\n  hubspot_contact_list_enabled: false                     # Disables contact list models\n  hubspot_contact_list_member_enabled: false              # Disables contact list member models\n  hubspot_contact_merge_audit_enabled: true               # Enables the use of the CONTACT_MERGE_AUDIT table (deprecated by Hubspot v3 API) for removing merged contacts in the final models.\n                                                          # If false, contacts will still be merged using the CONTACT.property_hs_calculated_merged_vids field.\n                                                          # Default = False\n  hubspot_contact_property_enabled: false                 # Disables the contact property models\n  hubspot_contact_property_history_enabled: false         # Disables the contact property history models\n  hubspot_email_event_enabled: false                      # Disables all email_event models and functionality\n  hubspot_email_event_bounce_enabled: false\n  hubspot_email_event_click_enabled: false\n  hubspot_email_event_deferred_enabled: false\n  hubspot_email_event_delivered_enabled: false\n  hubspot_email_event_dropped_enabled: false\n  hubspot_email_event_forward_enabled: false\n  hubspot_email_event_click_enabled: false\n  hubspot_email_event_open_enabled: false\n  hubspot_email_event_print_enabled: false\n  hubspot_email_event_sent_enabled: false\n  hubspot_email_event_spam_report_enabled: false\n  hubspot_email_event_status_change_enabled: false\n\n  # Sales\n\n  hubspot_sales_enabled: false                            # Disables all sales models\n  hubspot_company_enabled: false\n  hubspot_company_property_history_enabled: false         # Disables the company property history models\n  hubspot_deal_enabled: false\n  hubspot_deal_company_enabled: false\n  hubspot_deal_contact_enabled: false\n  hubspot_deal_property_history_enabled: false            # Disables the deal property history models\n  hubspot_engagement_enabled: false                       # Disables all engagement models and functionality\n  hubspot_engagement_call_enabled: false\n  hubspot_engagement_company_enabled: false\n  hubspot_engagement_communication_enabled: true          # Enables the link between communications and engagements. Default = False\n  hubspot_engagement_contact_enabled: false\n  hubspot_engagement_deal_enabled: false\n  hubspot_engagement_email_enabled: false\n  hubspot_engagement_meeting_enabled: false\n  hubspot_engagement_note_enabled: false\n  hubspot_engagement_task_enabled: false\n  hubspot_merged_deal_enabled: true                       # Enables the merged_deal table to filter merged deals from final models. Default = False\n  hubspot_owner_enabled: false\n  hubspot_property_enabled: false                         # Disables property and property_option tables\n  hubspot_role_enabled: false                             # Disables role metadata\n  hubspot_team_enabled: false                             # Disables team metadata\n  hubspot_team_user_enabled: false                        # Disables user-to-team relationships\n\n  # Service\n  hubspot_service_enabled: true                           # Enables all service models. Default = False\n  hubspot_ticket_deal_enabled: true                       # Enables ticket_deal transformations. Default = False\n```\n\n### (Optional) Additional configurations\n\n#### Configure email metrics\nThis package allows you to specify which email metrics (total count and total unique count) you would like to be calculated for specified fields within the `hubspot__email_campaigns` model. By default, the `email_metrics` variable below includes all the shown fields. If you would like to remove any field metrics from the final model, you may copy and paste the below snippet within your root `dbt_project.yml` and remove any fields you want to be ignored in the final model.\n\n```yml\nvars:\n  email_metrics: ['bounces',      #Remove if you do not want metrics in final model.\n                  'clicks',       #Remove if you do not want metrics in final model.\n                  'deferrals',    #Remove if you do not want metrics in final model.\n                  'deliveries',   #Remove if you do not want metrics in final model.\n                  'drops',        #Remove if you do not want metrics in final model.\n                  'forwards',     #Remove if you do not want metrics in final model.\n                  'opens',        #Remove if you do not want metrics in final model.\n                  'prints',       #Remove if you do not want metrics in final model.\n                  'spam_reports', #Remove if you do not want metrics in final model.\n                  'unsubscribes'  #Remove if you do not want metrics in final model.\n                  ]\n```\n#### Include passthrough columns\nThis package includes all source columns defined in the macros folder. We highly recommend including custom fields in this package as models now only bring in a few fields for the `company`, `contact`, `deal`, and `ticket` tables. You can add more columns using our pass-through column variables. These variables allow for the pass-through fields to be aliased (`alias`) and casted (`transform_sql`) if desired, but not required. Datatype casting is configured via a sql snippet within the `transform_sql` key. You may add the desired sql while omitting the `as field_name` at the end and your custom pass-though fields will be casted accordingly. Use the below format for declaring the respective pass-through variables in your root `dbt_project.yml`.\n\n```yml\nvars:\n  hubspot__deal_pass_through_columns:\n    - name:           \"property_field_new_id\"\n      alias:          \"new_name_for_this_field_id\"\n      transform_sql:  \"cast(new_name_for_this_field as int64)\"\n    - name:           \"this_other_field\"\n      transform_sql:  \"cast(this_other_field as string)\"\n  hubspot__contact_pass_through_columns:\n    - name:           \"wow_i_can_add_all_my_custom_fields\"\n      alias:          \"best_field\"\n  hubspot__company_pass_through_columns:\n    - name:           \"this_is_radical\"\n      alias:          \"radical_field\"\n      transform_sql:  \"cast(radical_field as string)\"\n  hubspot__ticket_pass_through_columns:\n    - name:           \"property_mmm\"\n      alias:          \"mmm\"\n    - name:           \"property_bop\"\n      alias:          \"bop\"\n```\n**Alternatively**, if you would like to simply pass through **all columns** in the above four tables, add the following configuration to your dbt_project.yml. Note that this will override any `hubspot__[table_name]_pass_through_columns` variables.\n\n```yml\nvars:\n  hubspot__pass_through_all_columns: true # default is false\n```\n#### Adding property label\nFor `property_hs_*` columns, you can enable the corresponding, human-readable `property_option`.`label` to be included in the staging models.\n\n##### Important\n- You must have sources `property` and `property_option` enabled to enable labels. By default, these sources are enabled.\n- You CANNOT enable labels if using `hubspot__pass_through_all_columns: true`.\n- We recommend being selective with the label columns you add. As you add more label columns, your run time will increase due to the underlying logic requirements.\n\nTo enable labels for a given property, set the property attribute `add_property_label: true`, using the below format.\n\n```yml\nvars:\n  hubspot__ticket_pass_through_columns:\n    - name: \"property_hs_fieldname\"\n      alias: \"fieldname\"\n      add_property_label: true\n```\nAlternatively, you can enable labels for all passthrough properties by using variable `hubspot__enable_all_property_labels: true`, formatted like the below example.\n\n```yml\nvars:\n  hubspot__enable_all_property_labels: true\n  hubspot__ticket_pass_through_columns:\n    - name: \"property_hs_fieldname1\"\n    - name: \"property_hs_fieldname2\"\n```\n\n#### Including calculated fields\nThis package also provides the ability to pass calculated fields through to the `company`, `contact`, `deal`, and `ticket` staging models. If you would like to add a calculated field to any of the mentioned staging models, you may configure the respective `hubspot__[table_name]_calculated_fields` variables with the `name` of the field you would like to create, and the `transform_sql` which will be the actual calculation that will make up the calculated field.\n```yml\nvars:\n  hubspot__deal_calculated_fields:\n    - name:          \"deal_calculated_field\"\n      transform_sql: \"existing_field * other_field\"\n  hubspot__company_calculated_fields:\n    - name:          \"company_calculated_field\"\n      transform_sql: \"concat(name_field, '_company_name')\"\n  hubspot__contact_calculated_fields:\n    - name:          \"contact_calculated_field\"\n      transform_sql: \"contact_revenue - contact_expense\"\n  hubspot__ticket_calculated_fields:\n    - name:          \"ticket_calculated_field\"\n      transform_sql: \"total_field / other_total_field\"\n```\n#### Filtering email events\nWhen leveraging email events, HubSpot customers may take advantage of filtering out specified email events. These filtered email events are present within the `stg_hubspot__email_events` model and are identified by the `is_filtered_event` boolean field. By default, these events are included in the staging and downstream models generated from this package. However, if you wish to remove these filtered events you may do so by setting the `hubspot_using_all_email_events` variable to false. See below for exact configurations you may provide in your `dbt_project.yml` file:\n```yml\nvars:\n  hubspot_using_all_email_events: false # True by default\n```\n\n#### Daily ticket history\nThe `hubspot__daily_ticket_history` model is disabled by default, but will materialize if `hubspot_service_enabled` is set to `true`. See additional configurations for this model below.\n\n\u003e **Note**: `hubspot__daily_ticket_history` and its parent intermediate models are incremental. After making any of the below configurations, you will need to run a full refresh.\n\n##### **Tracking ticket properties**\nBy default, `hubspot__daily_ticket_history` will track each ticket's state, pipeline, and pipeline stage and pivot these properties into columns. However, any property from the source `TICKET_PROPERTY_HISTORY` table can be tracked and pivoted out into columns. To add other properties to this end model, add the following configuration to your `dbt_project.yml` file:\n\n```yml\nvars:\n  hubspot__ticket_property_history_columns:\n    - the\n    - list\n    - of \n    - property\n    - names\n```\n\n##### **Extending ticket history past closing date**\nThis package will create a row in `hubspot__daily_ticket_history` for each day that a ticket is open, starting at its creation date. A Hubspot ticket can be altered after being closed, so its properties can change after this date.\n\nBy default, the package will track a ticket up to its closing date (or the current date if still open). To capture post-closure changes, you may want to extend a ticket's history past the close date. To do so, add the following configuration to your root dbt_project.yml file:\n\n```yml\nvars:\n  hubspot:\n    ticket_history_extension_days: integer_number_of_days # default = 0\n```\n\n#### Changing the Build Schema\nBy default this package will build the HubSpot staging models within a schema titled (\u003ctarget_schema\u003e + `_stg_hubspot`) and HubSpot final models within a schema titled (\u003ctarget_schema\u003e + `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 root `dbt_project.yml` file:\n\n```yml\nmodels:\n    hubspot:\n      +schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.\n      staging:\n        +schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.\n```\n\n#### Change the source table references\nIf 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:\n\n\u003e IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_hubspot/blob/main/dbt_project.yml) variable declarations to see the expected names.\n\n```yml\nvars:\n    hubspot_\u003cdefault_source_table_name\u003e_identifier: your_table_name\n```\n\n### (Optional) Orchestrate your models with Fivetran Transformations for dbt Core™\n\u003cdetails\u003e\u003csummary\u003eExpand for details\u003c/summary\u003e\n\u003cbr\u003e\n\nFivetran offers the ability for you to orchestrate your dbt project through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt#transformationsfordbtcore). Learn how to set up your project for orchestration through Fivetran in our [Transformations for dbt Core™ setup guides](https://fivetran.com/docs/transformations/dbt/setup-guide#transformationsfordbtcoresetupguide).\n\u003c/details\u003e\n\n## Does this package have dependencies?\nThis 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](https://hub.getdbt.com/) site.\n\u003e 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.\n\n```yml\npackages:\n    - package: fivetran/fivetran_utils\n      version: [\"\u003e=0.4.0\", \"\u003c0.5.0\"]\n\n    - package: dbt-labs/dbt_utils\n      version: [\"\u003e=1.0.0\", \"\u003c2.0.0\"]\n\n    - package: dbt-labs/spark_utils\n      version: [\"\u003e=0.3.0\", \"\u003c0.4.0\"]\n```\n\n\u003c!--section=\"hubspot_maintenance\"--\u003e\n## How is this package maintained and can I contribute?\n\n### Package Maintenance\nThe Fivetran team maintaining this package only maintains the [latest version](https://hub.getdbt.com/fivetran/hubspot/latest/) of the package. We highly recommend you stay consistent with the latest version of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_hubspot/blob/main/CHANGELOG.md) and release notes for more information on changes across versions.\n\n### Contributions\nA small team of analytics engineers at Fivetran develops these dbt packages. However, the packages are made better by community contributions.\n\nWe 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](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657).\n\n\u003c!--section-end--\u003e\n\n## Are there any resources available?\n- If you have questions or want to reach out for help, see the [GitHub Issue](https://github.com/fivetran/dbt_hubspot/issues/new/choose) section to find the right avenue of support for you.\n- 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](https://www.surveymonkey.com/r/DQ7K7WW).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Fdbt_hubspot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivetran%2Fdbt_hubspot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Fdbt_hubspot/lists"}