Online store

Storefront events (data layer)

Every storefront page publishes shopper events. They power the Google Analytics 4, Google Tag Manager, Google Ads and Meta Pixel apps, and you can consume them yourself.

EventWhenMeta Pixel
page_viewEvery page / client navigationPageView
view_itemProduct pageViewContent
view_item_listCollection page—
searchSearch resultsSearch
add_to_cartAdd to cart / Buy it nowAddToCart
view_cartCart page—
begin_checkoutCheckout pageInitiateCheckout
purchaseOrder confirmation (once per order)Purchase (eventID = order name)

window.dataLayer (GA4 ecommerce format)

JavaScript
window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({
  event: "purchase",
  ecommerce: {
    transaction_id: "#1001", currency: "INR", value: 2157.3, tax: 329.08, shipping: 0, coupon: "WELCOME10",
    items: [{ item_id: "…", item_name: "Classic Cotton Tee", item_variant: "M / Black", price: 799, quantity: 3 }]
  }
});

window.Sellify

Every storefront page exposes public store info as window.Sellify (like window.Shopify). Type Sellify in the browser console to inspect it. It is kept up to date on client-side navigation and never contains secrets.

JavaScript
Sellify.shop            // "demo.sellify.in" — the store's domain
Sellify.name            // "Sellify Demo Store"
Sellify.currency        // { active: "INR", rate: "1.0" }
Sellify.country         // "IN"
Sellify.locale          // "en"
Sellify.theme           // { id, name: "Aurora", role: "main", preset: "aurora" }
Sellify.routes          // { root: "/", cart: "/cart", search: "/search", collections: "/collections", allProducts: "/collections/all" }
Sellify.designMode      // true inside the theme editor preview
Sellify.previewMode     // true when previewing an unpublished theme
Sellify.published       // false while the store is password protected
Sellify.page            // { type: "product", resourceId: "<uuid>", handle: "classic-cotton-tee" }
Sellify.meta.product    // { id, title, handle, vendor, type, tags, options, variants: [{ id, title, sku, price, compareAtPrice, available }] }
Sellify.meta.collection // on collection pages
Sellify.cart            // { itemCount: 2 }
Sellify.track({ name: "add_to_cart", params: { ecommerce: { … } } }) // send an event through the data layer

Prices in Sellify.meta are integers in minor units (paise). page.type is one of index, product, collection, list-collections, search, cart, checkout, page, order.

Custom pixels

Add code to assets/custom.js and listen for sellify:event:

JavaScript
window.addEventListener("sellify:event", (e) => {
  const { name, params } = e.detail;
  if (name === "purchase") {
    // e.g. a TikTok / Snap / affiliate pixel
    console.log("order", params.ecommerce.transaction_id, params.ecommerce.value);
  }
});
Events are not sent from theme editor previews. You are responsible for collecting any consent your jurisdiction requires before loading third-party pixels.