How to read tracking data on this site
This page is for anyone who adds or maintains a tracking script (Google Tag Manager, a tag vendor, or Salesforce Data 360 Website Connector) without access to the storefront source code. It explains what appears in the browser, when it is sent, and what shape it has, so you can subscribe, forward, or validate it against your schema.
It is listed under Playground documentation on the Guide hub—not a numbered step in the implementation sequence.
How to inspect (in the browser only)
- Open the storefront in Chrome (or any browser with DevTools).
- Go to Console and type:
window.dataLayer— array of objects (GTM/GA4 style).window.sfWebInteractionsDataLayer— array used by the Data 360 Website Connector pattern on this site.
- Walk the user journey (home → product → add to cart → checkout → pay → confirmation) and note new entries after each step.
gtag may add extra objects to dataLayer (for example config and internal calls). Filter rows that have an event property when you map business events.
window.dataLayer — what, when, form
Objects are pushed in order. Many rows look like { event: "…", … }. Common event values on this site:
event (or role) | When it typically appears | Common payload shape / keys |
|---|---|---|
page_view | Initial load of many URLs, and again when the user changes category filter on the homepage (URL query changes) | page_title, page_location, page_path; on filtered home, may include category (category name). |
product_view | Product detail page load | { event: "product_view", ecommerce: { currency, value, items: [ { item_id, item_name, price, item_category?, … } ] } } |
search | Search results page when the URL contains a query | search_term, results_count |
login_success | Right after a successful login, on the next page load (redirect) | user_email |
sign_up_success | Right after successful registration, on the next page load | user_email |
view_item_list | When the main product grid first shows (all products or a category) | ecommerce.items[] with item_id, item_name, price, item_category, list metadata where set |
view_item | Product detail (GA4-style) | ecommerce with items[] as above |
view_cart | User opens the cart page (once per visit when cart has items) | ecommerce with currency, value, items[] |
add_to_cart | User adds a line to the cart | ecommerce with items[] (includes quantity) |
remove_from_cart | User removes an item or sets quantity to zero | ecommerce with items[] |
begin_checkout | User lands on checkout with a non-empty cart | ecommerce with cart line items |
add_shipping_info | User submits shipping details on checkout | ecommerce (and optional shipping hints) |
add_payment_info | User clicks the simulated pay action | ecommerce |
purchase | After simulated payment and/or when the order confirmation screen loads with order lines | ecommerce with transaction_id, value, currency, items[] — confirmation load is the reliable moment for final line items |
view_search_results | Search results page (GA4-style) | search_term and often ecommerce.items for shown products |
Money: amounts are typically decimal numbers; currency is usually a string (e.g. PLN).
window.sfWebInteractionsDataLayer — what, when, form
Second array, same window. Used so Data 360–style connectors can read page types and events with an explicit flag.
Two recurring shapes:
A) Page typing
{ pageType: "<string>", sendEvent: true, contextualAttributes?: { ... } }
Examples of pageType you may see: home, category, product_detail, cart, checkout, search, search_results, order_confirmation, account, guide, error_page.
contextualAttributes may carry category_id, category_name, product_id, product_name, order_id, search_term, etc., depending on the page.
B) Event mirroring (GA4-aligned)
{ event: "<name>", sendEvent: true, ecommerce?: { ... }, search_term?: "..." }
Same event names as in the GA4 helpers for this site (e.g. view_item, add_to_cart, purchase, begin_checkout, view_search_results).
Login / sign-up may appear as:
{ event: "login" | "sign_up", method: "email", user_email: "...", sendEvent: true }
On a product page, you will often see both a pageType: "product_detail" row and an event: "view_item" row.
Custom browser events (window — not inside dataLayer)
These are DOM events on window. They are not pushed into dataLayer. Use them only if your integration listens with addEventListener.
| Event name | When | event.detail |
|---|---|---|
purchaseInDataLayer | After a purchase payload is pushed to dataLayer on the order confirmation screen | Same object as the push: { event: "purchase", ecommerce: { ... } } |
cartUpdated | After add-to-cart, remove, or quantity change | (empty — no payload) |
There is no generic “something was pushed to dataLayer” event for every row—only purchaseInDataLayer for purchase on confirmation, plus cartUpdated for cart mutations.
Example:
window.addEventListener("purchaseInDataLayer", function (e) {
var payload = e.detail;
// payload.event === "purchase", payload.ecommerce has transaction_id, items, etc.
});
Practical checklist for your tracking script
- Decide whether you read
dataLayer,sfWebInteractionsDataLayer, or both (connector docs usually describe the second). - After each key user action, dump the last few array elements and match
event/pageTypeto your web schema in Data Cloud or your tag triggers. - For purchase, prefer the payload that appears when the order confirmation URL is shown; it includes final line items.
- If you need a hook in code without polling
dataLayer, usepurchaseInDataLayerfor purchase only; for everything else, poll or use GTM triggers.