Snowplow E-commerce Package
The package source code can be found in the snowplow/dbt-snowplow-ecommerce repo, and the docs for the model design here.
The package contains a fully incremental model that transforms raw web e-commerce event data generated by the Snowplow JavaScript tracker or Mobile Trackers into a set of derived tables based around the following e-commerce data objects: carts, checkouts, products and transactions.
The Snowplow e-commerce data model aggregates Snowplow's out of the box snowplow_ecommerce_action
events to create a set of derived tables based on the e-commerce data objects - carts, checkouts, products, transactions, users - that contain many useful dimensions as well as calculated measures.
Overviewโ
The package contains multiple staging models however the mart models are as follows:
- Base: Performs the incremental logic, outputting the table
snowplow_ecommerce_base_events_this_run
which contains a de-duped data set of all events required for the current run of the model, and is the foundation for all other models generated. - Carts: Parses the cart interactions that occur to provide handy filters and aggregations, which helps identify what happened to carts on a session level to extract, for example, abandoned carts with ease. The Carts module outputs the tables
snowplow_ecommerce_cart_interactions
. - Checkouts: Parses checkout steps that occur to provide handy filters and aggregations to help identify which checkout steps were walked through, and what details were entered in each of these steps. This lends itself well to a funnel analysis. The Checkouts module outputs the
snowplow_ecommerce_checkout_interactions
table. - Products: Parses product view and list information to provide insights into which products were being viewed, what details were being shown to the end user and how the user then interacted with these products. The Products module outputs the
snowplow_ecommerce_product_interactions
table. - Transactions: Parses transaction actions to provide insights into which transactions occurred, how much revenue was generated from them, and other insights leveraging the many properties of the transaction e-commerce context. The Transactions module outputs the
snowplow_ecommerce_transaction_interactions
table. - Sessions: Aggregates all other data into a sessions table which leverages the
domain_sessionid
, outputting thesnowplow_ecommerce_sessions
table.
Mixing web and mobile eventsโ
The package makes no distinction between events tracked from the web and those tracked from a mobile application, so long as you are tracking snowplow_ecommerce_action
events and from allowed app_id
s. The sessionId
from the client_session
context, and the id
from the mobile_screen
context, overwrite the domain_sessionid
and page_view_id
fields respectively in our intermediate and derived tables, for events where they are populated. If you are just using web events, the package will work out the box. If you are using a mix of web and mobile events, you will need to enable set the snowplow__enable_mobile_events
package variable to true
and events will be processed from both sources. If you are only tracking mobile events, the package will work with the variable set, however you must have the webPage
context available in your warehouse (even though it will not be populated for these mobile events) for the package to run.