Direct HTTP Integration

This document describes the payload format expected by the Splio web collector endpoint. This is an alternative to the GTM implementation described here: https://dev-scp.splio.com/docs/web-tracking.

Prerequisites

Before implementing your tracker, Splio will provide you with two configuration settings:

SettingDescription
Collector URLThe full endpoint URL including your tenant identifier, e.g. https://collector.example.com/collector/v1/a1b2c3d4-5678-90ab-cdef-1234567890ab/com.snowplowanalytics.snowplow/tp2
App IDThe sub-tenant identifier to use in every event payload (the aid field). Identifies your site/shop within Splio

These settings are specific to your account and will be communicated to you during onboarding.

All requests must be sent as POST with Content-Type: application/json. The collector responds 200 ok on success and 400 ko on error.

Root Payload Structure

{
  "schema": "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",
  "data": [ { /* one or more event objects */ } ]
}
KeyTypeDescription
schemastringMust be iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4
dataarrayArray of event objects. Multiple events can be batched in a single request

Event Object Fields

Each object in data uses Snowplow tracker protocol short keys:

KeyTypeRequiredLabel / Description
estringYesEvent type. pv = page view, ue = self-describing event, se = custom structured event
eidstringYesEvent ID. UUID to uniquely identify this event
aidstringYesApp ID / Sub-tenant ID. Identifies your sub-tenant (shop, site). Value provided by Splio (see Prerequisites)
tnastringYesTracker namespace. Identifier of your tracker instance
dtmstringYesDevice timestamp. Unix epoch in milliseconds when the event occurred
stmstringNoSent timestamp. Unix epoch in milliseconds when the event was sent
tvstringYesTracker version. E.g. js-3.16.0
pstringYesPlatform. web, mob, pc, srv, app, tv, cnsl, iot
urlstringYesPage URL. Full URL of the current page
pagestringNoPage title. Human-readable page name
refrstringNoPage referrer. URL of the previous page
uidstringYesUser ID. Business-level user identifier set by your application. Used as primary anonymous user identifier (fallback: duid, then sid)
duidstringNoDomain user ID. First-party cookie-based user identifier
sidstringNoSession ID. UUID identifying the current browsing session
vidintegerNoVisit index. Number of sessions for this user
cookiestringNoCookie flag. "1" if cookies are enabled
csstringNoCharset. Document character encoding, e.g. UTF-8
langstringNoLanguage. Browser language, e.g. en-US, fr-FR
resstringNoScreen resolution. Format WIDTHxHEIGHT, e.g. 1920x1080
cdstringNoColor depth. E.g. 24
tzstringNoTimezone. IANA timezone, e.g. Europe/Paris
vpstringNoViewport size. Format WIDTHxHEIGHT
dsstringNoDocument size. Format WIDTHxHEIGHT
cxstringNoContexts (base64). Base64-encoded JSON containing context entities (see below)
ue_pxstringNoSelf-describing event payload (base64). Base64-encoded JSON (see below)

Contexts

Contexts provide additional data attached to any event. They are sent as a JSON structure base64-encoded in cx:

{
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    { "schema": "...", "data": { ... } }
  ]
}

Supported Contexts

Web Page Context

Schema: iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0

KeyTypeLabel / Description
idstringPage ID. UUID uniquely identifying this page view

Logged User Context

Schema: jsonschema:com.splio/logged_user/1-0-0

KeyTypeLabel / Description
userIdstringUser ID. Identifier of the logged-in user
(Note: if the user id is an email, it must be hashed with SHA256)
sourceIdstringSource ID. Identifier of the user source system

Product Context

Schema: jsonschema:com.splio/product/1-0-0

Attach this context to a page view (e=pv) to signal a product view.

KeyTypeLabel / Description
productSKUstringProduct SKU. Unique product identifier. Must be non-empty to be recognized as a product view

Thank You Page Context

Schema: jsonschema:com.splio/thank_you_page/1-0-0

Attach this context to a page view (e=pv) to signal a post-purchase confirmation page.

KeyTypeLabel / Description
purchase_completedstringPurchase completed flag. Must be non-empty to be recognized as a thank-you page view

Self-Describing Event Payloads

For events with e=ue or e=se, the specific payload is sent base64-encoded in ue_px:

{
  "schema": "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",
  "data": {
    "schema": "<event-specific-schema>",
    "data": { /* event fields */ }
  }
}

Add to Cart

Schema: iglu:com.snowplowanalytics.snowplow/add_to_cart/jsonschema/1-0-0

KeyTypeLabel / Description
skustringProduct SKU. Unique product identifier
quantitylongQuantity. Number of items added
namestringProduct name
categorystringProduct category
unitPricedecimalUnit price
currencystringCurrency. ISO 4217 code, e.g. USD, EUR

Remove from Cart

Schema: iglu:com.snowplowanalytics.snowplow/remove_from_cart/jsonschema/1-0-0

KeyTypeLabel / Description
skustringProduct SKU. Unique product identifier
quantitylongQuantity. Number of items removed
namestringProduct name
categorystringProduct category
unitPricedecimalUnit price
currencystringCurrency. ISO 4217 code, e.g. USD, EUR

Event Type Summary

EventSnowplow e valueHow to trigger
Page ViewpvSend a pv event without product or thank-you context
Product ViewpvSend a pv event with a com.splio/product context containing a non-empty productSKU
Thank You Page ViewpvSend a pv event with a com.splio/thank_you_page context containing a non-empty purchase_completed
Add to Cartue or seSend with add_to_cart schema in self-describing payload
Remove from Cartue or seSend with remove_from_cart schema in self-describing payload

Examples

Page View

{
  "schema": "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",
  "data": [
    {
      "e": "pv",
      "url": "<https://myshop.com/>",
      "page": "Home Page",
      "refr": "<https://google.com/>",
      "eid": "327cb43a-99d1-457f-b51b-838e42cdefec",
      "tv": "js-3.16.0",
      "tna": "myTracker",
      "aid": "<APP_ID>",
      "p": "web",
      "cookie": "1",
      "cs": "UTF-8",
      "lang": "fr-FR",
      "res": "1280x800",
      "cd": "24",
      "dtm": "1697027286353",
      "vp": "1280x661",
      "ds": "1280x661",
      "vid": "7",
      "sid": "497da6e9-eddb-4e7a-be53-a1f68e91f0ab",
      "duid": "00d82103-2908-4498-ad5c-f726ebad36bc",
      "cx": "eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy9jb250ZXh0cy9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6W3sic2NoZW1hIjoiaWdsdTpjb20uc25vd3Bsb3dhbmFseXRpY3Muc25vd3Bsb3cvd2ViX3BhZ2UvanNvbnNjaGVtYS8xLTAtMCIsImRhdGEiOnsiaWQiOiJhMWIyYzNkNC1lNWY2LTc4OTAtYWJjZC1lZjEyMzQ1Njc4OTAifX1dfQ==",
      "stm": "1697027291931"
    }
  ]
}

Contexts (decoded cx):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }
    }
  ]
}

Product View

{
  "schema": "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",
  "data": [
    {
      "e": "pv",
      "url": "<https://myshop.com/product/876661122392077>",
      "page": "Cool T-Shirt - MyShop",
      "eid": "48ac2222-45d5-4006-8f7a-128f22ea9867",
      "tv": "js-3.16.0",
      "tna": "myTracker",
      "aid": "<APP_ID>",
      "p": "web",
      "cs": "UTF-8",
      "lang": "en-US",
      "res": "2100x1313",
      "cd": "24",
      "tz": "Europe/Paris",
      "dtm": "1701194783907",
      "sid": "4a4cbcfd-243f-433f-a4f6-7cffffb7e252",
      "duid": "662fc3c6-2f63-4e33-b53c-cdc9656c2b14",
      "cx": "eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy9jb250ZXh0cy9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6W3sic2NoZW1hIjoianNvbnNjaGVtYTpjb20uc3BsaW8vcHJvZHVjdC8xLTAtMCIsImRhdGEiOnsicHJvZHVjdFNLVSI6IjkxOTc5MDc1NDM0NDU2NzYifX0seyJzY2hlbWEiOiJqc29uc2NoZW1hOmNvbS5zcGxpby9sb2dnZWRfdXNlci8xLTAtMCIsImRhdGEiOnsidXNlcklkIjoidXNyLTAwMDQyIiwic291cmNlSWQiOiJzaG9wcGluZy1zaXRlIn19LHsic2NoZW1hIjoiaWdsdTpjb20uc25vd3Bsb3dhbmFseXRpY3Muc25vd3Bsb3cvd2ViX3BhZ2UvanNvbnNjaGVtYS8xLTAtMCIsImRhdGEiOnsiaWQiOiJiMmMzZDRlNS1mNmE3LTg5MDEtYmNkZS1mMjM0NTY3ODkwMTIifX1dfQ==",
      "stm": "1701194783908"
    }
  ]
}

Contexts (decoded cx):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    {
      "schema": "jsonschema:com.splio/product/1-0-0",
      "data": { "productSKU": "9197907543445676" }
    },
    {
      "schema": "jsonschema:com.splio/logged_user/1-0-0",
      "data": { "userId": "usr-00042", "sourceId": "shopping-site" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012" }
    }
  ]
}

Thank You Page View

Same as a Page View (e=pv) with a thank-you page context:

{
  "schema": "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",
  "data": [
    {
      "e": "pv",
      "url": "<https://myshop.com/checkout/thank-you>",
      "page": "Thank You - MyShop",
      "eid": "d4e5f6a7-b8c9-0123-def4-567890123456",
      "tv": "js-3.16.0",
      "tna": "myTracker",
      "aid": "<APP_ID>",
      "p": "web",
      "dtm": "1701194800000",
      "duid": "662fc3c6-2f63-4e33-b53c-cdc9656c2b14",
      "cx": "eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy9jb250ZXh0cy9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6W3sic2NoZW1hIjoianNvbnNjaGVtYTpjb20uc3BsaW8vdGhhbmtfeW91X3BhZ2UvMS0wLTAiLCJkYXRhIjp7InB1cmNoYXNlX2NvbXBsZXRlZCI6InRydWUifX0seyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy93ZWJfcGFnZS9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6eyJpZCI6ImMzZDRlNWY2LWE3YjgtOTAxMi1jZGVmLTM0NTY3ODkwMTIzNCJ9fV19",
      "stm": "1701194800001"
    }
  ]
}

Contexts (decoded cx):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    {
      "schema": "jsonschema:com.splio/thank_you_page/1-0-0",
      "data": { "purchase_completed": "true" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "c3d4e5f6-a7b8-9012-cdef-345678901234" }
    }
  ]
}

Add to Cart

{
  "schema": "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",
  "data": [
    {
      "e": "ue",
      "eid": "6a70302f-982e-4bab-8af3-519fc3b84f84",
      "tv": "js-3.16.0",
      "tna": "myTracker",
      "aid": "<APP_ID>",
      "p": "web",
      "cs": "UTF-8",
      "lang": "en-US",
      "res": "1680x1050",
      "cd": "24",
      "tz": "Europe/Paris",
      "dtm": "1697757327323",
      "sid": "f47d0c2c-1e09-4933-b7a8-d125ab2119f9",
      "duid": "22695db9-63e1-41a1-adea-dcc81f64b619",
      "url": "<https://myshop.com/>",
      "refr": "<https://myshop.com/product/8552515751438644>",
      "ue_px": "eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy91bnN0cnVjdF9ldmVudC9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy9hZGRfdG9fY2FydC9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6eyJza3UiOiI4NTUyNTE1NzUxNDM4NjQ0IiwicXVhbnRpdHkiOjEsIm5hbWUiOiJDcm9wcGVkIFN0YXkgR3Jvb3Z5IG9mZiB3aGl0ZSIsImNhdGVnb3J5IjoidC1zaGlydCIsInVuaXRQcmljZSI6MTAuOSwiY3VycmVuY3kiOiJVU0QifX19",
      "cx": "eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy9jb250ZXh0cy9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6W3sic2NoZW1hIjoianNvbnNjaGVtYTpjb20uc3BsaW8vbG9nZ2VkX3VzZXIvMS0wLTAiLCJkYXRhIjp7InVzZXJJZCI6InVzci0wMDA0MiIsInNvdXJjZUlkIjoic2hvcHBpbmctc2l0ZSJ9fSx7InNjaGVtYSI6ImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L3dlYl9wYWdlL2pzb25zY2hlbWEvMS0wLTAiLCJkYXRhIjp7ImlkIjoiZDRlNWY2YTctYjhjOS0wMTIzLWRlZjQtNTY3ODkwMTIzNDU2In19XX0=",
      "stm": "1697757327324"
    }
  ]
}

Self-describing payload (decoded ue_px):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",
  "data": {
    "schema": "iglu:com.snowplowanalytics.snowplow/add_to_cart/jsonschema/1-0-0",
    "data": {
      "sku": "8552515751438644",
      "quantity": 1,
      "name": "Cropped Stay Groovy off white",
      "category": "t-shirt",
      "unitPrice": 10.9,
      "currency": "USD"
    }
  }
}

Contexts (decoded cx):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    {
      "schema": "jsonschema:com.splio/logged_user/1-0-0",
      "data": { "userId": "usr-00042", "sourceId": "shopping-site" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "d4e5f6a7-b8c9-0123-def4-567890123456" }
    }
  ]
}

Remove from Cart

Identical to Add to Cart, but the self-describing payload uses:

"schema": "iglu:com.snowplowanalytics.snowplow/remove_from_cart/jsonschema/1-0-0"

How to Implement

For JavaScript implementation details (tracker setup, event tracking code), refer to the Javascript Snowplow Libraries guide.


Did this page help you?