# Tracking Pixel in finish.tpl

**URL:** <https://forum.shopware.com/t/tracking-pixel-in-finish-tpl/56321>\
**Category:** Programmierung\
**Created:** [8. November 2018 um 15:36 UTC](https://forum.shopware.com/t/tracking-pixel-in-finish-tpl/56321 "2018-11-08T15:36:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zalchris](https://avatars.discourse-cdn.com/v4/letter/z/90ced4/32.png) [@zalchris](https://forum.shopware.com/u/zalchris)\
**Post date:** [8. November 2018 um 15:36 UTC](https://forum.shopware.com/t/tracking-pixel-in-finish-tpl/56321/1 "2018-11-08T15:36:51Z")

</div>

Hallo!

Ich habe angefügtes Javascript im Theme in die /frontend/checkout/finish.tpl eingefügt.

Es soll ein Tracking Pixel feuern. Die Ausgabe auf der Success-Seite ist laut Quelltext auch OK, nur leider wird das Pixel nicht gefeuert.

Kann mir hier jemand weiterhelfen?

&nbsp;

```
// Your organization ID; provided by Cashback World.
var organization=2180429;
//
// Event ID; provided by Cashback World.
var event=380921;
//
// Value of the sale; sale specific value has to be assigned dynamically out of the shop database. The orderValue is the basis for the commission paid to Cashback World.
var orderValue = "{$sAmountNet}";
//
// Currency of the sale. For example “USD” for US-Dollar, or “EUR” for Euro.
var currency = "EUR";
//
// A unique identifier for the transaction. You should assign your internal shop order number dynamically out of your shop database. For a sale, this is typically the order number which is also shown to a customer in the order confirmation.
var orderNumber = "{$sOrderNumber}";
//
// Event type:
// true = Sale
// false = Lead
var isSale = true;
//
// Encrypted connection on this page:
// true = Yes (https)
// false = No (http)
var isSecure = true;
//
// OPTIONAL: You may transmit a list of items ordered in the reportInfo parameter. See chapter reportInfo (3.4.7.) at the “Tracking Implementation” Manual for details.
var reportInfo = ""; reportInfo = "f1=" + Product1Name + "&f2=" + Product1ID + "&f3=" +
NumberOfProduct1 + "&f4=" + Product1Price + "|f1=" + Product2Name + "&f2=" + Product2ID + "&f3=" +
NumberOfProduct2 + "&f4=" + Product2Price;
reportInfo = escape(reportInfo);
//
function getCookie(name)
{
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1)
{
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else
{
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1)
{
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}
var tduid = getCookie("TRADEDOUBLER");
/ *****IMPORTANT:***** /
/ *****In most cases, you should not edit anything below this line.***** /
if (isSale)
{
var domain = "tbs.tradedoubler.com";
var checkNumberName = "orderNumber";
}
else
{
var domain = "tbl.tradedoubler.com";
var checkNumberName = "leadNumber";
var orderValue = "1";
}
//
//Create the checksum. See chapter checksum (3.4.1.) at the “Tracking Implementation” Manual for details.
var checksum = "xxx";
//
if (isSecure)
var scheme = "https";
else
var scheme = "http";
//
var trackBackUrl = scheme + "://" + domain + "/report" + "?organization=" + organization + "&event="
+ event + "&" + checkNumberName + "=" + orderNumber + "&checksum=" + checksum + "&tduid=" + tduid +
"&type=iframe&reportInfo=" + reportInfo;
if (isSale)
{
trackBackUrl = trackBackUrl + "&orderValue=" + orderValue + "&currency=" + currency;
}
//
function prepareFrame(tburl){
ifrm = document.createElement("IFRAME");
ifrm.setAttribute("src", tburl);
ifrm.style.width = 1+"px";
ifrm.style.height = 1+"px";
ifrm.style.border = "none";
document.body.appendChild(ifrm);
}
prepareFrame(trackBackUrl);

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [8. November 2018 um 15:48 UTC](https://forum.shopware.com/t/tracking-pixel-in-finish-tpl/56321/2 "2018-11-08T15:48:24Z")

</div>

Schau mal hier, da hat schon jemand sich die Arbeit gemacht:&nbsp;[https://forum.shopware.com/discussion/2906/php-in-tpl-datein](https://forum.shopware.com/discussion/2906/php-in-tpl-datein).

Aufgefallen/nicht vorhande ist mir $isSecure und {literal} bei dir.
