Ecommerce events
Snowplow provides support for tracking and modeling events from ecommerce stores directly in our trackers and data models.
Events and context entities
Ecommerce action event
Each ecommerce event is a self-describing event using a single ecommerce action schema.
The events are distinguished by their type property, which is different for each Event class tracked.
snowplow_ecommerce_action
EventSchema URIiglu:com.snowplowanalytics.snowplow.ecommerce/snowplow_ecommerce_action/jsonschema/1-0-2
Tracker compatibility
Web: ✅Mobile: ✅Tracked automatically: ❌
Example
json
{
"type": "list_view",
"name": "shop the look"
}
Schema
- Table
- JSON schema
| Property | Description |
|---|---|
type | Required. Standard ecommerce actions. Must be one of: add_to_cart, remove_from_cart, product_view, list_click, list_view, promo_click, promo_view, checkout_step, transaction, refund, trns_error |
namestring | Optional. The name of the list presented to the user E.g. product list, search results, shop the look, frequently bought with. |
json
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"description": "Schema for an Ecommerce action",
"self": {
"vendor": "com.snowplowanalytics.snowplow.ecommerce",
"name": "snowplow_ecommerce_action",
"format": "jsonschema",
"version": "1-0-2"
},
"type": "object",
"properties": {
"type": {
"description": "Standard ecommerce actions.",
"enum": [
"add_to_cart",
"remove_from_cart",
"product_view",
"list_click",
"list_view",
"promo_click",
"promo_view",
"checkout_step",
"transaction",
"refund",
"trns_error"
]
},
"name": {
"description": "The name of the list presented to the user E.g. product list, search results, shop the look, frequently bought with.",
"type": [
"string",
"null"
],
"maxLength": 128
}
},
"required": [
"type"
],
"additionalProperties": false
}
Warehouse query
- Snowflake
- BigQuery
- Databricks
- Redshift & Postgres
sql
select
unstruct_event_com_snowplowanalytics_snowplow_ecommerce_snowplow_ecommerce_action_1 snowplow_ecommerce_action_1
from
atomic.events
where
events.collector_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'snowplow_ecommerce_action'
and events.event_vendor = 'com.snowplowanalytics.snowplow.ecommerce'
sql
select
unstruct_event_com_snowplowanalytics_snowplow_ecommerce_snowplow_ecommerce_action_1_0_2
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'snowplow_ecommerce_action'
and events.event_vendor = 'com.snowplowanalytics.snowplow.ecommerce'
sql
select
unstruct_event_com_snowplowanalytics_snowplow_ecommerce_snowplow_ecommerce_action_1
from
atomic.events events
where
events.collector_tstamp > timestampadd(HOUR, -1, current_timestamp())
and events.event = 'unstruct'
and events.event_name = 'snowplow_ecommerce_action'
and events.event_vendor = 'com.snowplowanalytics.snowplow.ecommerce'
and unstruct_event_com_snowplowanalytics_snowplow_ecommerce_snowplow_ecommerce_action_1 is not null
sql
select
"snowplow_ecommerce_action_1".*
from
atomic.events events
join atomic.com_snowplowanalytics_snowplow_ecommerce_snowplow_ecommerce_action_1 "snowplow_ecommerce_action_1"
on "snowplow_ecommerce_action_1".root_id = events.event_id and "snowplow_ecommerce_action_1".root_tstamp = events.collector_tstamp
where
events.collector_tstamp > getdate() - interval '1 hour'
and "snowplow_ecommerce_action_1".root_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'snowplow_ecommerce_action'
and events.event_vendor = 'com.snowplowanalytics.snowplow.ecommerce'
Ecommerce context entities
All tracked ecommerce properties are tracked as context entities.
Cart
cart
EntitySchema URIiglu:com.snowplowanalytics.snowplow.ecommerce/cart/jsonschema/1-0-0
Tracker compatibility
Web: ✅Mobile: ✅Tracked automatically: ❌
Example
json
{
"cart_id": null,
"currency": "EUR",
"total_value": 12
}
Schema
- Table
- JSON schema
| Property | Description |
|---|---|
cart_idstring | Optional. The unique ID representing this cart. |
total_valuenumber | Required. The total value of the cart after this interaction. |
currencystring | Required. The currency used for this cart (ISO 4217). |
json
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"description": "Schema for a cart entity in Ecommerce",
"self": {
"vendor": "com.snowplowanalytics.snowplow.ecommerce",
"name": "cart",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"properties": {
"cart_id": {
"description": "The unique ID representing this cart.",
"type": [
"string",
"null"
],
"maxLength": 4096
},
"total_value": {
"description": "The total value of the cart after this interaction.",
"type": "number",
"minimum": 0,
"multipleOf": 0.01,
"maximum": 9999999
},
"currency": {
"description": "The currency used for this cart (ISO 4217).",
"type": "string",
"maxLength": 3,
"minLength": 3
}
},
"required": [
"total_value",
"currency"
],
"additionalProperties": false
}
Checkout step
checkout_step
EntitySchema URIiglu:com.snowplowanalytics.snowplow.ecommerce/checkout_step/jsonschema/1-0-0
Tracker compatibility
Web: ✅Mobile: ✅Tracked automatically: