tl;dr
Create a Klar Pixel datasource, validate your domain, and add the tracking script as a Custom HTML tag on All Pages.
Four events are required: Product Viewed, Add to Cart, Update Checkout and Order.
Remove from Cart, Shipping Info and Payment Info are recommended. They complete your funnel view per channel and campaign.
Send the same product ID your shop system sends to Klar. Step 4 shows which one that is for your shop system.
Test everything in GTM Preview before publishing. Then watch your pixel coverage build up in the Action Centre.
Before you start
You'll need:
Publish access to your Google Tag Manager container.
A data layer that fires on your key shop actions. Ideally the standard GA4 ecommerce events (
view_item,add_to_cart,begin_checkout,purchase…).A cart ID and checkout ID from your shop system. No IDs available? Use a session ID instead → Creating a session ID in Google Tag Manager.
Access to your DNS settings (for Domain Validated tracking).
Which events should I send?
Event | When to fire | GA4 data layer event | Priority |
Base script (visit / page view) | Every page load | All Pages (Page View trigger) | Required |
| Product detail page |
| Required |
| Product added to cart |
| Required |
| Customer enters checkout |
| Required |
| Order confirmation page |
| Required |
| Product removed from cart |
| Recommended |
| Shipping details entered |
| Recommended |
| Payment details entered |
| Recommended |
| Any custom goal (e.g. newsletter sign-up) | your own event | Optional |
| Email captured in a signup form | your form's submit event | Optional |
Why send the recommended events too? The required events cover attribution and the core funnel. Remove from Cart, Shipping Info and Payment Info show where customers drop off inside the checkout, per channel and campaign.
Step 1: Add the Klar Pixel datasource
Go to Store Configurator → Data Sources and click Add New Data Source.
Select Klar Pixel.
Name the datasource, e.g.
Klar Tracking Script.Choose Domain Validated (recommended) or Basic and click Configure.
We strongly recommend Domain Validated. The script then runs under your own subdomain (e.g. 123456789.yourshop.com). Ad blockers and browser privacy settings are far less likely to block it.
Multiple top level domains? If you have more than one top level domain, create a separate Pixel datasource for each top level domain.
Chose Basic? Your tracking script appears right away. Skip to Step 3.
Step 2: Set up your DNS records (Domain Validated only)
Enter your shop domain, without
https://and withoutwww.Add the two DNS records Klar shows you (CNAME and CNAME IPv4) at your DNS provider.
Click Verify DNS Records. Propagation usually takes a few hours, in rare cases up to 48 hours.
Once both records show a green checkmark, copy the Tracking Script.
⚠️ GoDaddy, WebGo, All Inkl, Strato — common gotcha: These providers ask you to enter just the subdomain part in the "Name" field, not the full hostname. Strip your domain from the value Klar provides:
CNAME Name — Wrong:
123456789.yourshop.com→ Right:123456789CNAME IPv4 Name — Wrong:
123456789-4.yourshop.com→ Right:123456789-4
Step 3: Add the base script in GTM
In GTM, click Tags → New and choose Custom HTML.
Paste the Klar tracking script.
Set the trigger to All Pages (Page View).
Name the tag
Klar – Base Scriptand save.
Consent: fire the base script according to your consent setup, the same way as your other analytics tags.
Step 4: Create your variables
Create these as Data Layer Variables (Variables → New → Data Layer Variable). Adjust the paths to your data layer.
GTM variable | Value | Used in |
| your shop's cart ID, or the session ID variable | Add to Cart, Remove from Cart, Update Checkout, Order |
| your shop's checkout ID, or the session ID variable | Update Checkout, Shipping Info, Payment Info |
| your shop's order number | Order |
| your shop's customer ID (empty for guests) | Update Checkout, Order |
| the product ID for your shop system (see table below). In GA4 format usually | Product Viewed, Add to Cart, Remove from Cart |
No cart or checkout ID? Use one session ID for both → Creating a session ID in Google Tag Manager.
Which product ID should I send?
The productId must be the same ID your shop system sends to Klar. Otherwise product views and cart actions can't be matched to your products and orders. Check what your data layer puts into item_id: it is often the SKU or a variant ID, which may not be the right one.
Shop system | Send as |
Shopware 6 | The product UUID of the item. For variants, the variant's UUID (in Shopware, a variant is a product with a parent). |
Shopware 5 | The article number. If it is empty, the article name. |
WooCommerce | The variation ID for variable products, otherwise the product ID. |
Oxid | The article OXID. For variants, the variant OXID. |
BigCommerce | The product variant ID. If there is none, the product name. |
Klar API | The |
Step 5: Add the required events
Create one Custom HTML tag per event. Use a Custom Event trigger with the matching data layer event name.
Fire order matters. Each event tag must fire after the base script. Under Advanced Settings → Tag Sequencing, set Klar – Base Script to fire before the event tag.
Product Viewed
Trigger: view_item
<script>
window._k_q = window._k_q || [];
window._k_q.push(["Klar:sendProductViewedEvent", {
productId: "{{DLV – Item ID}}"
}]);
</script>
Add to Cart
Trigger: add_to_cart
<script>
window._k_q = window._k_q || [];
window._k_q.push(["Klar:sendAddToCartEvent", {
cartId: "{{DLV – Cart ID}}",
productId: "{{DLV – Item ID}}"
}]);
</script>
Update Checkout
Trigger: begin_checkout
<script>
window._k_q = window._k_q || [];
window._k_q.push(["Klar:sendUpdateCheckoutEvent", {
checkoutId: "{{DLV – Checkout ID}}",
cartId: "{{DLV – Cart ID}}",
customerId: "{{DLV – Customer ID}}"
}]);
</script>
Order
Trigger: purchase (order confirmation page)
<script>
window._k_q = window._k_q || [];
window._k_q.push(["Klar:sendOrderEvent", {
orderId: "{{DLV – Order ID}}",
cartId: "{{DLV – Cart ID}}",
customerId: "{{DLV – Customer ID}}"
}]);
</script>
Guest checkouts: leave customerId empty. Missing cartId or checkoutId? Use your session ID for both.
The orderId must match the order ID Klar receives from your shop system. Otherwise the order can't be matched to its customer journey.
Step 6: Add the recommended events
Same setup as Step 5: one Custom HTML tag per event, fired after the base script.
Remove from Cart
Trigger: remove_from_cart
<script>
window._k_q = window._k_q || [];
window._k_q.push(["Klar:sendRemoveFromCartEvent", {
cartId: "{{DLV – Cart ID}}",
productId: "{{DLV – Item ID}}"
}]);
</script>
Shipping Info
Trigger: add_shipping_info
<script>
window._k_q = window._k_q || [];
window._k_q.push(["Klar:sendShippingInfoEvent", {
checkoutId: "{{DLV – Checkout ID}}"
}]);
</script>
Payment Info
Trigger: add_payment_info
<script>
window._k_q = window._k_q || [];
window._k_q.push(["Klar:sendPaymentInfoEvent", {
checkoutId: "{{DLV – Checkout ID}}"
}]);
</script>
Step 7: Add optional events
Custom conversions (up to 10, e.g. newsletter sign-up) → How to Track Custom Conversions with Klar
Signup email (better session stitching for signups before the first order) → Signup Email Tracking — Set-Up
Step 8: Test before you publish
Click Preview in GTM and open your shop.
Walk through a full journey: product page → add to cart → remove an item → checkout → shipping → payment → test order.
In Tag Assistant, check that
Klar – Base Scriptfires on every page and each event tag fires on its trigger.Open your browser's developer tools. Failed events show a descriptive error in the Console.
When everything fires, click Submit and publish the container.
Step 9: Add the data privacy snippet
Add Klar's data privacy snippet to your privacy policy. You'll find it in the Klar Pixel datasource settings, below the tracking script, under Data Protection Snippet (German and English).
Step 10: Set up URL parameters in your ad accounts
To accurately match conversions and costs across channels, add Klar's tracking parameters to your ad URLs. Guides per channel:
What happens next?
Klar starts tracking right away. Attribution data appears in your reports from the next day, only from the moment the pixel went live, not retroactively. You can follow how your pixel coverage builds up over the next 30 days in the Action Centre → Overview.
🎉 That's it, your Klar Pixel is live.




