Basket Tracking (Client-Side)
Introduction
This tracking code is used to track the shopping basket and must be included in the <body> tag of the store's "checkout successful" page. The variables of the function "eamTrackAddBasketItem()" must be filled with the appropriate values.
Implementation
JavaScript-Code |
<script src="https://SUB-DOMAIN/trck/ebasket/ebasket.js"></script> <script language="javascript"> /* must be created for each item in the shopping cart*/ eamTrckAddBasketItem(KAMPAGNEN-ID, TOKEN, TRIGGER_ID, ARTICLE_NUMBER, AMOUNT, PRICE, EMID, PRODUCTNAME, CATEGORY, ATTRIBUTION, { 'variable' : 'VARIABLE_CONTENT', 'variable_2' : 'VARIABLE_CONTENT_2' }) /* must be created for each item in the shopping cart*/ eamTrckSubmitBasket(); </script> |
Example
JavaScript-Code |
<script src="https://pvn.example.com/trck/ebasket/ebasket.js"></script> <script language="javascript"> eamTrckAddBasketItem('1', '12345', '1', '002973000902', '1', '335.29', '5eeb0e0dabf7ad282b28c4a2', 'Samsung TV', 'TV','0.5', { 'vc' : 'vouchercode12345', 'colour' : 'grey'}); eamTrckAddBasketItem('1', ‘12345', ‘1', ‘000657001803', '1’, '25.13’, 5eeb0e0dabf7ad282b28c4a2, 'TV WALL HOLDERS’, 'Living room’,1.0,{ 'vc' : 'Vouchercode12345', 'colour' : 'black', 'Subcategory' : 'TV wall holders'}); eamTrckSubmitBasket(); </script> |
Variable description
The function is filled with parameters according to the table:
VARIABLE | BESCHREIBUNG |
CAMPAIGN_ID | The campaign ID is stored here. |
TOKEN | The order number / order ID is stored here. |
TRIGGER_ID | The trigger ID is stored here. |
ARTICLE_NUMBER | Is filled with the respective product ID |
AMOUNT | Will be replaced with the number of times the corresponding product was bought |
PRICE | Filled with the NET price of the individual product |
EMID | Is filled with the value of the parameter emid, which is transferred from easy.affiliate to the landing page via the clicklink. |
PRODUCTNAME | Filled with the product name. |
CATEGORY | The product category is stored here. |
ATTRIBUTION | Here the attribute of the order is stored. The value is transferred in decimal format and a point as separator. (50% = 0.50) |
Additional Parameter: For the inclusion of further parameters, these must be included in the code, in the curved brackets, comma-separated. The freely selectable name of the variable is introduced with apostrophe. This is followed by a colon and then the value of the variable as a string, also in apostrophes. | |
Declaration | {'variable' : 'VARIABLE_CONTENT'} |
Example | {'vc' : 'Voucher12345', 'Brand' : 'Samsung'} |
Voucher implementation
In many stores vouchers are offered to the users to grant discounts. Often these vouchers are included in the calculation of remuneration. Here it is important to distinguish between conventional discount vouchers and percentage discount vouchers. In addition, vouchers are often linked to a minimum order value.
In order to ensure a clean deduction of the voucher and also in the event of cancellation or partial cancellation of items are still deducted correct values, the following implementation by voucher type is recommended. The voucher values are then automatically adjusted by the tracking routines.
Discount vouchers:
For discount vouchers an additional basketitem is added with the function eamTrckAddBasketItem(); in which the value to be deducted is stored. Additionally the following additional parameters are needed:
discount_absolute: → The actual value to be deducted in Euro.
minimum_turnover: → The minimum order value for the coupon to be valid. This refers to the total of the entire shopping cart.
Example:
JavaScript-Code |
<script src="https://pvn.example.com/trck/ebasket/ebasket.js"></script> <script language="javascript"> eamTrckAddBasketItem('1', ‘12345’, ‘1', ‘002973000902’, '1’, '335.29', '5eeb0e0dabf7ad282b28c4a2', 'Samsung TV', 'TV',0.5, {'Color' : 'black'}); eamTrckAddBasketItem('1', ‘12345’, ‘1', 'Vouchercode', '1’, '-10.00', '5eeb0e0dabf7ad282b28c4a2', 'Voucher', 'winter discount ',1.0,{ 'discount_absolute' : 10, 'minimum_turnover' : 15}); eamTrckSubmitBasket(); </script> |
Percentage discount vouchers:
For percentage discount vouchers, no additional item needs to be added to the basket. Instead, the following parameters are stored at each basket item:
discount_absolute: → The actual discounted value in euros.
discount_percentage: → The percentage value to be deducted.
minimum_turnover:→ The minimum order value for the voucher to remain valid. This refers to the total of the entire shopping cart.
It is crucial that all parameters are filled per basket item, because on the one hand this provides a control instance, and on the other hand this allows automatic adjustments to be made to the basket item if, for example, a cancellation or partial cancellation is made and the voucher loses its validity due to the minimum order value. This fact is very important to consider, especially for loyalty and cashback portals.
Example:
JavaScript-Code |
<script src="https://pvn.example.com/trck/ebasket/ebasket.js"></script> <script language="javascript"> eamTrckAddBasketItem('1', ‘12345’, ‘1', ‘002973000902’, '1’, '1000.00', '5eeb0e0dabf7ad282b28c4a2', 'Samsung TV', 'TV',0.5, { 'discount_absolute' : 100, 'discount_percentage' : 10, 'minimum_turnover' : 15}); eamTrckAddBasketItem('1', ‘12345’, ‘1', '000657001803', '1’, '29.99', '5eeb0e0dabf7ad282b28c4a2', 'TV WALL HOLDERS', 'LIVING ROOM',1.0,{ 'discount_absolute' : 2.999, 'discount_percentage' : 10, 'minimum_turnover' : 15}); eamTrckSubmitBasket(); </script> |