This guide is intended for merchants who do not want to implement Kelkoo Group leadtag.js but want to reimplement the logic themselves.
Minimal implementation of lead tag
This is the minimal mechanism you need to implement
KELKOO.Tracking._getUrlParamValue = function (name) {
var bareUrlRegex = new RegExp("[\\?&]" + name + "=([\\w\\-]+)", "gi");
var result = bareUrlRegex.exec(document.location.search);
var activeObserveHandle = null;
if (result) {
activeObserveHandle = result[1];
}
return activeObserveHandle;
};
KELKOO.Tracking.setCookieAndStorage = function (name, value) {
var d = new Date;
d.setTime(d.getTime() + 365 * 24 * 60 * 60 * 1E3);
document.cookie = name + "=" + value + "; expires=" + d.toGMTString() + "; path=/; domain=acme.com; SameSite=Strict";
sessionStorage.setItem(name, value);
localStorage.setItem(name, value);
};
var kk = KELKOO.Tracking._getUrlParamValue("kk");
KELKOO.Tracking.setCookieAndStorage("kelkooId", kk);
var gclid = KELKOO.Tracking._getUrlParamValue("gclid");
KELKOO.Tracking.setCookieAndStorage("kk_gclid", gclid);
kk/kelkooId URL parameter
The kk parameter that holds the kelkooId information is automatically appended to the URL by Kelkoo Group System whenever a user clicks one of your ads.
The prerequesite for this is to have a conversion tag up and running. No other action is needed on your side.