Skip to main content
All CollectionsTracking Implementation
Implement the Klarna Creator tracking - General guide
Implement the Klarna Creator tracking - General guide
Hanna Mattsson avatar
Written by Hanna Mattsson
Updated over a week ago

The tracking is completely client side javascript powered with a first-party cookie. Include this tag as soon as possible after the beginning of the <body> tag of the html document. The script has to be included on every page on your website.

<script type="text/javascript" defer="" src="https://conversion.klarnaservices.com/kc.js"></script>


This is the script which will control the tracking in the store. It will keep track of any tracking parameters and recognise traffic coming from any Klarna Creator affiliate link. If you are performing any kind of redirect on traffic coming to your page then it is important that you pass along any GET parameters because that is the way we keep track of the visitors.

For all websites it's important that the cookie follow along on any redirects made between different domains. Please see separate guide to ensure this is implemented correctly: COOKIE DECOR ON REDIRECTS

To implement the tracking part of this on your conversion page, you have to include a javascript tag with the data about the conversion before the inclusion of the tracking script, like we have done in the template below.

The template looks like this (replace the variables (E.G. {{ order_value }}) with the actual value) An example screenshot is also available further down.

/* ---------------------------- START KLARNA CREATOR SCRIPT INIT CONVERSION OBJECT---------------------------- */ 
<script>
/* Do not edit this part */
var APPRL={};
APPRL.Tracking={};
APPRL.Tracking.Sale={};

/* Conversion data */
APPRL.Tracking.Sale.order_id='{{ order_id }}'; // Order id from store
APPRL.Tracking.Sale.order_value='{{ order_value }}'; // The order value
APPRL.Tracking.Sale.currency='{{ currency }}'; // Currency, has to be three letters i.e. SEK, GBP, EUR

/* Optional product tracking data */
APPRL.Tracking.Sale.sku='{{ product_sku_1 }}^{{ product_sku_2 }}^{{ product_sku_n }}';
APPRL.Tracking.Sale.quantity='{{ product_qty_1 }}^{{ product_qty_2 }}^{{ product_qty_n }}';
APPRL.Tracking.Sale.price='{{ product_price_1 }}^{{ product_price_2 }}^{{ product_price_n }}';
</script>
/* ---------------------------- END KLARNA CREATOR SCRIPT INIT CONVERSION OBJECT ---------------------------- */
<script type="text/javascript" defer="" src="https://conversion.klarnaservices.com/kc.js"></script>


OBS - This must be called after tracking object is configured

<script type="text/javascript" defer="" src="https://conversion.klarnaservices.com/kc.js"></script>


Mandatory variables:

  • order_id:
    Is the local order id the vendor has in their system. It is used as a reference to recognize the orders in Klarna Creators system. Need to be unique.

  • order_value:
    Order value VAT excluded. Any decimals should be declared with a standard dot like this "100.10".

  • currency:
    The currency of the order value.

Optional variables:

  • sku:
    A string of product identifiers separated by a "^". For products item1, item2 and item3 the sku would be 'item1^item2^item3'. It is declared as a string.

  • quantity:
    The quantity of the items being declared in the sku variable. Let’s say item1:s quantity was 1 unit, item2:s 3 units and item3:s 5 units. That would give a quantity parameter like this '1^3^5'. It is declared as a string.

  • price:
    The price of each individual item, usually VAT included. Item1:s price being 10 SEK, item2:s 30 SEK and item3:s price is 50 SEK. That would give the following price parameter '10^30^50'. It is declared as a string. The currency does not have to be included, it is assumed to be the same as the currency declared prior.


Examples:

Please note that the image attached below includes our old tracking script. But the details and result reference is the same.

This is what a successful implementation would look like on the conversion page. The conversion data in the example below is included before the declaration of the tracking script. Do remember that the script has to be included on every page, not just the conversion page.

Did this answer your question?