Produces modeled tables that leverage Amplitude data from Fivetran's connector in the format described by this ERD and builds off the output of our Amplitude source package.
Enables users to do the following:
This package also generates a comprehensive data dictionary of your source and modeled Amplitude data through the dbt docs site. You can also refer to the table below for a detailed view of all tables materialized within this package by default.
Table | Description |
---|---|
amplitude__event_enhanced | Each record represents event data, enhanced with event type data and unnested event, group, and user properties. |
amplitude__sessions | Each record represents a distinct session with aggregated metrics for that session. |
amplitude__user_enhanced | Each record represents a distinct user with aggregated metrics for that user. |
amplitude__daily_performance | Each record represents performance metrics for each distinct day and event type. |
To use this dbt package, you must have the following:
If 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
file. 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']
Include the following Amplitude 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/amplitude version: [">=0.4.0", "<0.5.0"] # we recommend using ranges to capture non-breaking changes automatically
Do NOT include the amplitude_source
package in this file. The transformation package itself has a dependency on it and will install the source package as well.
By default, this package will run using your target database and the amplitude
schema. If this is not where your Amplitude data is, add the following configuration to your root dbt_project.yml
file:
# dbt_project.yml
...
config-version: 2
vars:
amplitude_database: your_database_name
amplitude_schema: your_schema_name
Because of the typical volume of event data, you may want to limit this package's models to work with a recent date range. However, note that the amplitude__daily_performance
, amplitude__event_enhanced
, and amplitude__sessions
final models are materialized as incremental tables.
The default date range for the stg_amplitude__event model starts at '2020-01-01' and ends one month past the current day. Conversely, for the date spine model in this package the default date range starts at 2020-01-01
and ends one day after the current day. To customize the date range, add the following configurations to your root dbt_project.yml
file:
# dbt_project.yml
...
vars:
amplitude__date_range_start: '2022-01-01' # your start date here
amplitude__date_range_end: '2022-12-01' # your end date here
If you adjust the date range variables, we recommend running dbt run --full-refresh
to ensure no data quality issues within the adjusted date range.
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 rootpackages.yml
to avoid package version conflicts.packages: - package: fivetran/amplitude_source version: [">=0.3.0", "<0.4.0"]
- 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](https://hub.getdbt.com/fivetran/amplitude/latest/) of the package and refer to the [CHANGELOG](https://github.com/fivetran/dbt_amplitude/blob/main/CHANGELOG.md) and release notes for more information on changes across versions.
### Opinionated Decisions
In creating this package, which is meant for a wide range of use cases, we had to take opinionated stances on a few different questions we came across during development. We've consolidated significant choices we made in the [DECISIONLOG.md](https://github.com/fivetran/dbt_amplitude/blob/main/DECISIONLOG.md), and will continue to update as the package evolves. We are always open to and encourage feedback on these choices, and the package in general.
### Contributions
These dbt packages are developed by a small team of analytics engineers at Fivetran. However, the packages are made better by community contributions.
We highly encourage and welcome contributions to this package. Check out [this post](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) on the best workflow for contributing to a package.
## Are there any resources available?
- If you encounter any questions or want to reach out for help, see the [GitHub Issue](https://github.com/fivetran/dbt_amplitude/issues/new/choose) 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 future dbt package to be developed, then feel free to fill out our [Feedback Form](https://www.surveymonkey.com/r/DQ7K7WW).