This dbt package:
- Transforms pageviews into sessions
- For User stitching please enable builtin Jitsu feature Retroactive User Recognition
New to dbt packages? Read more about them here.
- Include this package in your
packages.yml
- Run
dbt deps
- Include the following in your
dbt_project.yml
directly within yourvars:
block (making sure to handle indenting appropriately). Update the value to point to your jitsu pageviews table.
# dbt_project.yml
config-version: 2
...
vars:
jitsu:
jitsu_events_table: "{{ source('jitsu', 'pageviews') }}" #or plane table path like database.schema.table_name
- Optionally configure extra parameters by adding them to your own
dbt_project.yml
file – see dbt_project.yml for more details:
# dbt_project.yml
config-version: 2
...
vars:
jitsu:
jitsu_events_table: "{{ source('jitsu', 'pageviews') }}"
jitsu_sessionization_trailing_window: 3
jitsu_session_inactivity_cutoff: 30 * 60
jitsu_pass_through_columns: ['event_type']
jitsu_model_materialized: incremental
- Execute
dbt seed
-- this project includes a CSV that must be seeded for it the package to run successfully. - Execute
dbt run
– the Jitsu Sessions models will get built
This package has been tested on PostgreSQL, ClickHouse, Redshift and BigQuery.
This package relies heavily on SQL window functions. Because Window functions are considered as an experimental feature in ClickHouse we cannot guarantee stable results of using this package with ClickHouse database
Currently, this package doesn't support incremental materialization with ClickHouse. Please set
jitsu_model_materialized
to table
Additional contributions to this repo are very welcome!