Revenue tracking
Bu içerik henüz dilinizde mevcut değil.
Your storefront owns the cart and the order. Report both back to the embed and the Revenue block in Analytics fills with verified revenue, orders, revenue per session and a channel breakdown.
Verified and reported
Section titled “Verified and reported”Two kinds of order reach Analytics, and they are kept apart:
- Verified — orders delivered by the Shopify webhook, signed with your store’s secret. These are revenue: the headline figure, the orders count, revenue per model open and the channel table are built from them only.
- Reported — orders your page sends with
purchased(). They appear under the tiles as reported by the storefront, unverified and are never added to revenue.
A reported order becomes verified when the webhook later delivers the same order id: the signed record replaces the reported one.
Cart adds
Section titled “Cart adds”Call addedToCart() after your cart call succeeds.
const tg = document.getElementById('tg');
tg.addedToCart({ value: 1249.5, // amount added, in major units currency: 'EUR', // any ISO 4217 code quantity: 2, sku: 'OSLO-BODY-WALNUT',});The Shopify connector calls this for you, with the value summed from
your mapped variant prices and the currency taken from Shopify.currency.active.
Orders — Shopify
Section titled “Orders — Shopify”Shopify’s checkout and thank-you pages do not carry the embed, so orders arrive through a webhook instead of a browser call.
- In Analytics → Revenue, enter your
*.myshopify.comdomain. The panel shows the webhook URL to use in the next step. - In your Shopify admin, create a webhook for the Order creation event in JSON format, pointing at the URL from step 1. Shopify keeps webhooks under the store’s notification preferences.
- Shopify shows the secret it signs your webhooks with on that same screen. Copy it, paste it into the panel’s Signing secret field and press Connect.
The connector stamps _togenar_pid and _togenar_src on every cart line it creates, so an
order is credited to the project it was configured in, with its channel. Order lines that
carry no Togenar property are ignored, and only those lines’ value is counted — not the
whole basket.
Deliveries are verified by HMAC-SHA256 against your secret. Test orders are ignored, and a redelivered or duplicated order is counted once.
If your page also calls purchased(), pass Shopify’s numeric order id as orderId so the
webhook delivery replaces the reported entry instead of sitting next to it.
Orders — any other storefront
Section titled “Orders — any other storefront”Call purchased() on your order-confirmation page, with the embed present. Orders reported
this way show as reported, unverified — see Verified and reported.
tg.purchased({ value: 1249.5, currency: 'EUR', orderId: '1001', // required quantity: 2,});orderId is required and is the deduplication key: a refreshed confirmation page, a retry
or a duplicate call with the same orderId is counted once.
Field reference
Section titled “Field reference”| Field | Type | Notes |
|---|---|---|
value |
number | Major units, up to 2 decimals. 0–10000000. |
currency |
string | Any ISO 4217 code, three letters — EUR, TRY, USD, RUB, BYN, GBP… |
orderId |
string | Required for purchased(). Max 128 characters. |
quantity |
number | Defaults to 1. |
sku |
string | Optional. |
An event with a missing or malformed value / currency is rejected, and purchased()
without an orderId is rejected. Amounts in different currencies are never added together:
each currency is totalled on its own.
Channel attribution
Section titled “Channel attribution”The embed reads utm_source, utm_medium, utm_campaign from the page URL and the page
referrer host, and attaches them to the commerce events. The Revenue by channel table
groups orders by those values; traffic with no UTM parameters is grouped under the referrer
host, or direct.
No cookies are set and no click identifiers are collected.
