Connect Shopify
The Klarvyn Tracking app connects every Shopify purchase back to the ad click that produced it — and can send server-side conversions (Meta CAPI) from the same data.
-
In Klarvyn, go to Settings → Integrations, open the Shopify card and enter your store’s
.myshopify.comaddress, then click Install app. -
Approve the app in the Shopify window. Webhooks, the tracking pixel and your storefront domains are set up automatically for this workspace.
-
Enable the theme app embed — this step is essential: in Shopify, go to Online Store → Themes → Customize → App embeds and toggle on Klarvyn Tracking (the Workspace ID is pre-filled). Save.
-
Place a test order — it appears in Contacts → Purchases with revenue within seconds.
What the app sends to Klarvyn
Section titled “What the app sends to Klarvyn”The app sends data from three places, each with its own job. Revenue only ever comes from Shopify’s servers, so a purchase is never counted twice.
1. From Shopify’s servers (webhooks)
Section titled “1. From Shopify’s servers (webhooks)”| Event | When | What it carries |
|---|---|---|
purchase |
An order is created or paid — one per order | Revenue, products, tax, shipping, discount and the customer’s email. The only source of revenue. |
refund |
A refund is issued | Negative revenue, the refunded products, and whether the items were restocked. |
2. From the theme app embed
Section titled “2. From the theme app embed”The embed runs on your store’s pages and can read cookies — it’s what ties an order to the visitor’s ad click.
| Event | When |
|---|---|
page_view |
Every page view — UTM parameters, ad click IDs and kv_ parameters drive attribution. |
add_to_cart |
A product is added to the cart. |
| Forms / identify | Anything the tracking script normally captures on a site, such as form submissions. |
3. From the Web Pixel
Section titled “3. From the Web Pixel”The pixel runs inside Shopify’s sandbox, including the checkout.
| Event | When |
|---|---|
product_view |
A product page is viewed. |
view_collection |
A collection is viewed. |
search |
Someone searches the store. |
view_cart |
The cart is viewed. |
remove_from_cart |
A product is removed from the cart. |
checkout_start |
The checkout opens. |
checkout_contact_info |
Contact details are filled in. |
checkout_address_info |
The address is filled in (city, country). |
checkout_shipping_info |
A shipping method is chosen. |
add_payment_info |
Payment details are filled in. |
checkout_completed |
The thank-you page is shown. Links the customer to the visitor — without an amount. |
Together these build your store funnel (view → cart → checkout → purchase) and fill in the contact timeline.
Fields per event
Section titled “Fields per event”purchase
| Field | Contents |
|---|---|
revenue, currency |
The order total and its currency |
order_id, order_name |
Shopify’s order ID and order number (#1234) |
processor_payment_id |
The order ID — used to match refunds to the order |
product_name, product_sku |
The first product in the order |
line_items[] |
Per product: name, sku, quantity, price (unit price), product_id, variant_id, line_item_id, tax, discount |
taxes, taxes_included |
Total tax, and whether prices include tax |
discount, shipping |
Total discount and shipping |
shop_domain, landing_site, referring_site |
The store, and Shopify’s first landing page and referring site |
utm_source / utm_medium / utm_campaign, fbc, fbp |
Taken from the visit (through the kv_vid in the cart) for attribution and Meta CAPI |
is_new_customer |
Whether this is the customer’s first purchase |
| Contact | The email — and through it, the contact and visitor |
refund
| Field | Contents |
|---|---|
revenue, currency |
A negative amount — what was actually paid back |
order_id, processor_payment_id, processor_refund_id |
The order and the refund |
refund_amount |
The refunded amount as a positive number |
product_name |
Set when exactly one product was refunded |
refund_line_items[] |
Per line: line_item_id, product_id, variant_id, name, quantity, subtotal (excl. tax), tax, restocked |
restocked |
Whether every line was restocked |
| Contact / visitor | Inherited from the purchase |
page_view and add_to_cart (theme app embed)
page_view — the page URL, referring site, utm_*, click IDs (fbclid,
gclid, ttclid and more), kv_ parameters, fbp/fbc and the consent
status. Klarvyn’s server adds the device, browser and location.
add_to_cart
| Field | Contents |
|---|---|
product_name / item_name |
The product name |
product_id, variant_id, sku, item_id |
IDs (item_id is the SKU, or the variant ID when there’s no SKU) |
price, quantity, value, currency |
Unit price, quantity, price × quantity, currency |
items[] |
item_id, item_name, sku, price, quantity |
Web Pixel events
Every pixel event also carries the visitor and session (kv_vid / kv_sid),
the page_url and source: shopify_pixel.
| Event | Fields |
|---|---|
product_view |
product_name, product_id, variant_id, variant_title, sku, item_id, price, quantity (1), value, currency, items[] |
view_collection |
collection_id, collection_title, product_count |
search |
query (the search text), result_count |
view_cart |
quantity (number of items), total, currency |
remove_from_cart |
product_title, product_id, quantity, price, currency |
checkout_start |
total, value, currency, line_items_count, product_name (the first product), items[] (item_id, item_name, sku, price, quantity) |
checkout_contact_info |
Same as checkout_start |
checkout_address_info |
Same as checkout_start, plus city and country |
checkout_shipping_info |
Same as checkout_start |
add_payment_info |
Same as checkout_start |
checkout_completed |
Stores only order_id, checkout_token and page_url. The email it carries is used to find or create the contact; the amount and products aren’t stored here, because revenue comes from the purchase webhook. |
In the checkout steps, item_id in items[] is the SKU or the variant ID —
product costs and Profit are calculated from the
purchase event, which carries the full product IDs.
Good to know
Section titled “Good to know”- The theme app embed is what makes attribution work. Without it, orders still record (via webhooks) but land unattributed — the embed is what ties the order to the visitor’s ad click.
- Consent-aware: on stores with a consent banner, rich tracking waits for the visitor’s consent via Shopify Customer Privacy.
- Orders without a customer email are skipped — Klarvyn needs the email to create the contact.
- Purchases with no revenue? That means the webhooks aren’t registered — re-open the Klarvyn app in Shopify, which re-runs the setup automatically.
- Headless storefront (Hydrogen, Webflow, Lovable…)? Use the Headless / manual setup section on the connect card to copy your Workspace ID and add the tracker manually.
- Uninstalling the app stops the flow but keeps all recorded data.