Partnerprogramm
Für Shops im eigenen Partnerprogramm von Fordeal: die Klicks, die wir Ihnen geschickt haben, die daraus entstandenen Bestellungen, Ihre Provision und die monatlichen Abrechnungen. Die Provision ist ein Prozentsatz des Bestellwerts ohne MwSt. und Versand und wird nach Ablauf der Rückgabefrist freigegeben.
Wird geladen…
So fügen Sie den Tracking-Code ein
Zwei Code-Teile. Der erste, auf jeder Seite, merkt sich den Fordeal-Klick 30 Tage lang in einem eigenen Cookie Ihres Shops. Der zweite, auf der Danke-Seite, meldet Fordeal die Bestellnummer und den Bestellwert. Keine Drittanbieter-Cookies und keine Kundendaten.
1. Code für jede Seite
Shoptet-Administration: Vzhled a obsah → Editor → HTML kód → Záhlaví (Kopfzeile).
<script>
(function () {
try {
var m = /[?&]fdclid=([0-9a-f-]{36})/i.exec(location.search);
if (!m) return;
// First-party cookie of the shop for 30 days; localStorage as a fallback.
document.cookie = "fdclid=" + m[1] + "; Max-Age=2592000; path=/; SameSite=Lax; Secure";
try { localStorage.setItem("fdclid", JSON.stringify({ id: m[1], at: Date.now() })); } catch (e) {}
} catch (e) {}
})();
</script>2. Code für die Danke-Seite
Shoptet-Administration: Vzhled a obsah → Editor → HTML kód → Dokončená objednávka (abgeschlossene Bestellung). Liest die Bestellung aus dem Shoptet-Datalayer (orderNo, total, totalWithoutVat).
<script>
(function () {
// true while testing: the order is stored as a test and is never billed.
var FORDEAL_TEST = false;
try {
var click = null;
var c = /(?:^|;\s*)fdclid=([0-9a-f-]{36})/i.exec(document.cookie);
if (c) click = c[1];
if (!click) {
try {
var saved = JSON.parse(localStorage.getItem("fdclid") || "null");
if (saved && Date.now() - saved.at < 2592000000) click = saved.id;
} catch (e) {}
}
if (!click) return; // the visitor did not come from Fordeal
var order_number = null, total = null, total_without_vat = null, currency = null;
var o = null;
try { if (typeof getShoptetDataLayer === "function") o = getShoptetDataLayer("order"); } catch (e) {}
if (!o && window.dataLayer) {
for (var i = 0; i < dataLayer.length; i++) {
if (dataLayer[i] && dataLayer[i].shoptet && dataLayer[i].shoptet.order) { o = dataLayer[i].shoptet.order; break; }
}
}
if (o) {
order_number = o.orderNo;
total = typeof o.total === "number" ? o.total : null;
if (typeof o.totalWithoutVat === "number") {
total_without_vat = Math.round((o.totalWithoutVat - (typeof o.shippingWithoutVat === "number" ? o.shippingWithoutVat : 0)) * 100) / 100;
}
currency = o.currencyCode || null;
}
var body = new Blob([JSON.stringify({
click_id: click,
order_number: order_number == null ? null : String(order_number),
total: total,
total_without_vat: total_without_vat,
currency: currency,
platform: "shoptet",
test: FORDEAL_TEST
})], { type: "text/plain" });
var url = "https://fordeal.ai/api/v1/deals/conversions";
if (!(navigator.sendBeacon && navigator.sendBeacon(url, body))) {
fetch(url, { method: "POST", mode: "no-cors", body: body, keepalive: true });
}
// Delete the click so a reload of this page does not report the order again.
document.cookie = "fdclid=; Max-Age=0; path=/; SameSite=Lax; Secure";
try { localStorage.removeItem("fdclid"); } catch (e) {}
} catch (e) {}
})();
</script>Test: Setzen Sie im Code der Danke-Seite FORDEAL_TEST = true, öffnen Sie Ihren Shop über einen Fordeal-Link und schließen Sie eine Bestellung ab. Sie erscheint oben in der Tabelle als „Test“ und wird nie abgerechnet. Danach wieder auf false setzen.