Data Foundations · Data Layer Engineering
We design and implement one documented data layer for your store, so GA4, Google Ads, Meta and Klaviyo all receive the same products, prices, orders and customer context, from the same source, on every page.
In plain terms
A data layer is a structured message your store publishes whenever something happens: a product viewed, an item added to cart, an order placed. Tags read from it instead of scraping the page. When it's well built, a theme redesign doesn't break tracking, every tool sees the same order value, and adding a new ad platform takes hours instead of a project.
When it's missing or inconsistent, each tag guesses from page content, and each tool ends up with a slightly different version of the truth.
Design rules
We use the GA4 ecommerce structure as the base, with an items array on every product event, so one spec serves every tag.
item_id matches the SKU or variant ID in your product feed, so ads, remarketing and reports join on the same key.
The previous ecommerce object is cleared before each new event, so values from one event never leak into the next.
Order value is defined once (for example, after discounts, before tax and shipping) and every tool receives the same number.
No raw emails or phone numbers in URLs or event parameters. Hashed identifiers go only to tags that need them, and only with consent.
Product cost and margin are added server-side for profit bidding, never exposed in page code where anyone can read them.
From the spec
An excerpt from a typical spec. Your version adapts to your platform, apps and reporting needs.
| Field | Example | Common mistake |
|---|---|---|
| event | purchase | Different names in different tools for the same order |
| transaction_id | Store order number | Missing, or a checkout token that changes on reload |
| value | Order subtotal after discounts | Tax and shipping included in one tool, excluded in another |
| currency | USD | Store default sent for orders paid in another currency |
| coupon | WELCOME10 | Not sent, so discount-driven orders can't be separated |
| items[] | item_id, item_name, price, quantity, item_category | Parent product ID sent instead of the variant ID in the feed |
| customer_type | new or returning | Not sent, so first and repeat orders look the same |
customer_type is a custom parameter we add because first-to-second order rate is the retention metric that matters most.
Platform specifics
Storefront events come from the theme. Checkout and purchase come from Shopify's customer events, which provide standard event payloads to app and custom pixels. Custom storefront events can be published to the same system with Shopify's analytics publish method.
We build the data layer from WooCommerce hooks or a proven plugin, then extend it where your setup needs more, such as subscriptions, bundles or product add-ons.
On Magento and Adobe Commerce, customer and cart values load through private content sections, so full-page cache can't serve one shopper's data to another.
Why margin belongs here
Bidding on revenue treats a $60 order with 20% margin the same as a $60 order with 60% margin. To bid on profit, the conversion value has to reflect margin. We design the data layer so each order can be enriched with product cost on the server, then sent to Google Ads and Meta as a profit value. It's the same structure that powers your event tracking.
Related services
The data layer feeds your Google Tag Manager container and your GA4 ecommerce events, and it's what a server-side setup forwards to ad platforms. It's also how Klaviyo gets reliable product and cart data for browse and cart recovery flows on Klaviyo. Part of Data Foundations.
FAQ
It's a structured object your store updates when shoppers act: viewing a product, adding to cart, starting checkout, purchasing. Tag Manager and other tools read product, price, order and customer details from it, instead of scraping text from the page. That makes tracking consistent across tools and much harder to break with a theme change.
Shopify's customer events give pixels standard payloads for checkout and purchase, which is a strong base. It doesn't publish a storefront data layer for GTM by default, and it won't add custom fields such as new vs. returning or bundle details. We map Shopify's events to one schema and fill the gaps from the theme.
Either. We write the specification and, on most stores, the implementation too. If your developers prefer to own the theme or platform code, we hand over a written spec with examples and acceptance tests, then validate their build in GTM preview and with test orders.
Not in plain text, and never in URLs. Enhanced conversions and Conversions API can use hashed email or phone to match conversions, but only for visitors who allow it under your consent setup. We send identifiers only to the tags that need them and document where they go.
Start with the free audit to see how your tracking looks today, or book a call to scope a data layer for your store.