/dbt-snowplow-web

A fully incremental model, that transforms raw web event data generated by the Snowplow JavaScript tracker into a series of derived tables of varying levels of aggregation.

Primary LanguageShellOtherNOASSERTION

maintained License Discourse posts

snowplow-logo

This package is in maintenance mode. This means it will only receive bug fixes and security patches as required. Future development of the Snowplow dbt models is being done in the Unified Digital package which you can get access to via the Snowplow Data Models Pack.

snowplow-web

This dbt package:

  • Transforms and aggregates raw web event data collected from the Snowplow JavaScript tracker into a set of derived tables: page views, sessions and users, plus an optional set of consent tables.
  • Derives a mapping between user identifiers, allowing for 'session stitching' and the development of a single customer view.
  • Processes all web events incrementally. It is not just constrained to page view events - any custom events you are tracking will also be incrementally processed.
  • Is designed in a modular manner, allowing you to easily integrate your own custom dbt models into the incremental framework provided by the package.

Please refer to the doc site for a full breakdown of the package.

Getting Started

The easiest way to get started is to follow our QuickStart guide, or to use our Advanced Analytics for Web Accelerator which includes steps for setting up tracking as well as modeling, and our Consent Tracking for Marketing Accelerator specifically for our Consent Management Platform models.

Adapter Support

The latest version of the snowplow-web package supports BigQuery, Databricks, Redshift, Snowflake & Postgres. For previous versions see our package docs.

Requirements

  • A dataset of web events from the Snowplow JavaScript tracker must be available in the database.
  • Have the webPage context enabled.
  • dbt-core version 1.6.0 or greater
  • You must be using RDB Loader v4.0.0 and above, or BigQuery Loader v1.0.0 and above, to ensure your data has the load_tstamp column. If you are not using these versions, or are using the Postgres loader, you will need to set snowplow__enable_load_tstamp to false in your dbt_project.yml and will not be able to use the consent models.

Installation

Check dbt Hub for the latest installation instructions.

Configuration & Operation

Please refer to the doc site for details on how to configure and run the package.

Models

The package contains multiple staging models however the output models are as follows:

Model Description
snowplow_web_page_views A table of page views, including engagement metrics such as scroll depth and engaged time.
snowplow_web_sessions An aggregated table of session events, including conversions [Optional], grouped on domain_sessionid.
snowplow_web_users An aggregated table of sessions to a user level, grouped on domain_userid.
snowplow_web_user_mapping Provides a mapping between user identifiers, domain_userid and user_id.
snowplow_web_consent_log [Optional] Incremental table showing the audit trail of consent and Consent Management Platform (cmp) events
snowplow_web_consent_users [Optional] By user consent stats
snowplow_web_consent_totals [Optional] Summary of the latest consent status as per consent version
snowplow_web_consent_scope_status [Optional] Aggregate of current number of users consented to each consent scope
snowplow_web_consent_cmp_stats [Optional] Used for modeling cmp_visible events and related metrics
snowplow_web_consent_versions [Optional] Used to keep track of each consent version and its validity

Please refer to the dbt doc site for details on the model output tables.

Join the Snowplow community

We welcome all ideas, questions and contributions!

For support requests, please use our community support Discourse forum.

If you find a bug, please report an issue on GitHub.

Copyright and license

The snowplow-web package is Copyright 2020-present Snowplow Analytics Ltd.

This distribution is all licensed under the Snowplow Community License, Version 1.0 . (If you are uncertain how it applies to your use case, check our answers to frequently asked questions.)