Setting it up

Conversion tracking code is asynchronous, it is not transmitted at regular intervals, thus making possible variable bit rate which won’t slow down your website (page). You should be familiar with the process if you already have added a Google Analytics conversion tracking code to you website.



Basket example

Conversion tracking code looks similar to shopping basket customers use on your website. It also contains all items customer is going to buy. Let’s say, customer bought this:

Internal ID of the item Name of the item Price per unit Amount Total price
HOTEL3440 Christmas in Dresden for two 3290 CZK 1 unit 3290 CZK
HOTEL8755 Weekend in Warsaw for one 2490 CZK 2 units 4980 CZK
PARKTICKET Entry to the Amusement park 790 CZK 2 units 1580 CZK
ORDER-2341 Total 9850 CZK

When a customer makes an order it will be created under transaction ID ORDER-2341, for example. The conversion tracking code HTML script will be following:

<script>
(function (m,u,j,s,k,r,z){m['SkrzAnalyticsObject']=k;m[k]=m[k]||function(){
(m[k].q=m[k].q||[]).push(arguments)},m[k].l=1*new Date();r=u.createElement(j),
z=u.getElementsByTagName(j)[0];r.async=1;r.src=s;z.parentNode.insertBefore(r, z)
})(window, document, 'script', '//muj.skrz.cz/analytics.js', 'sa');

sa("create",  "<CAMPAIGN_ID>");

sa("addItem", {"itemId":"HOTEL3440","unitPrice":"3290.00","quantity":"1","totalPrice":"3290.00"});
sa("addItem", {"itemId":"HOTEL8755","unitPrice":"2490.00","quantity":"2","totalPrice":"4980.00"});
sa("addItem", {"itemId":"PARKTICKET", "unitPrice":"790.00","quantity": "2","totalPrice":"1580.00"});

sa("send", {"transactionId":"ORDER-2341","isPaid":"1","grandTotal":"9850.00","currency":"CZK"});
</script>


Let’s discuss the specifics:

Main body

(function (m,u,j,s,k,r,z){m['SkrzAnalyticsObject']=k;m[k]=m[k]||function(){
(m[k].q=m[k].q||[]).push(arguments)},m[k].l=1*new Date();r=u.createElement(j),
z=u.getElementsByTagName(j)[0];r.async=1;r.src=s;z.parentNode.insertBefore(r, z)
})(window, document, 'script', '//muj.skrz.cz/analytics.js', 'sa');

Main body of the script always needs to be in the conversion tracking code. Serves for asynchronous loading of the script.



Campaign ID (identification)

sa("create",  "<CAMPAIGN_ID>");

Using create sets your ID. Phrase <SERVER_IDENT> needs to be replaced with real ID, it can be found in Muj.Skrz.cz campaign reporting - Settings menu > Analytics.

Also your Skrz sales representant will give you your campaign ID when it is created.



Adding purchased items

sa("addItem", {"itemId":"HOTEL3440","unitPrice":"3290.00","quantity":"1","totalPrice":"3290.00"});

Using addItem will add purchased items (accommodations) to the script. Following JSON object key values are used:

Key Value example Description
itemId HOTEL3440 Your internal ID of an item (accommodation) you offer. It has to be identical to item ID (accommodation) you send us in XML feed, otherwise a transaction cannot be paired with specific offer, thus reporting won’t be accurate. ID can consist of any mix of numbers, letters, dashes, etc. of your choice.

Always use quotation marks (") to prevent errors.
unitPrice 3290.00 Price per unit.
quantity 1 Quantity of ordered items (accommodations).
totalPrice 3290.00 Total price of an order, VAT included. Total price consist of unitPrice * quantity == totalPrice.

Always use quotation marks (") for any values (numbers included) to prevent errors.

For every item (unit/accommodation) use new line of code with addItem, unless the same item is ordered multiple times. You can add as many items as you like. For example, if a customer buys one accommodation, there would be one line of addItem code, if he buys two, three, etc., different accommodations, there would be two, three, etc., lines of code. Like here:

sa("addItem", {"itemId":"HOTEL3440","unitPrice":"3290.00","quantity":"1","totalPrice":"3290.00"});
sa("addItem", {"itemId":"HOTEL8755","unitPrice":"2490.00","quantity":"2","totalPrice":"4980.00"});

In case there is any additional payment/fee, outside the price of accommodation, a customer should pay, use addItem again, so grandTotalwill reflect the final price of whole order. For example:

sa("addItem", {"itemId":"PARKTICKET", "unitPrice":"790.00","quantity": "2","totalPrice":"1580.00"});


Sending a transaction

sa("send", {"transactionId":"ORDER-2341","isPaid":"1","grandTotal":"9850.00","currency":"CZK"});

Use send to send a transaction to our servers at Muj.Skrz.cz. Following JSON object key values are used:

Key Value example Description
transactionId ORDER-2341 Transaction ID. ID can consist of any mix of numbers, letters, dashes, etc. of your choice.

Always use quotation marks (") to prevent errors.
isPaid 1, or 0 Defines if a transaction was paid. 1 stands for paid. 0 stands for unpaid.

Use 1 only for immediate payment via credit/debit card, PayPal, etc. when a customer is charged during the order process.
grandTotal 9850.00 Total price to be paid by a customer, VAT included. grandTotal consist of every totalPrice from every addItem. This value is used to verify that conversion tracking code is set up correctly.
currency CZK Three digits ISO currency code for a currency used in transaction. For polish Zloty use CZK.

And that is all you need to do, we take care of the rest.



Contact our support at muj@skrz.cz or your Skrz.cz account manager, if you need any help with conversion tracking.

Skrz.cz s.r.o. (2024) Všeobecné obchodní podmínky | Pravidla pro zveřejňování nabídek