BigFish Online Help
Name: AFFILIATE_TRACKING
Scope: ALL_EXCEPT_ORDER_CONFIRM
Script:
<script type="text/javascript">
// store cookie value with optional details as needed
function setPixelCookie (name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape (value) +
((expires) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
</script>
<script type="text/javascript">
<#if parameters.affiliate?exists && parameters.affiliate?has_content>
setPixelCookie('AFFILIATE_TRACKING','${parameters.affiliate}');
</#if>
</script>
Pixel Tracking is stored in memory cache. Whenever you make modifications to scripts the cache will need to be reset.
To reset the cache use the Admin Tools
Reset Cache function.
Name: AFFILIATE_COMMISSION
Scope: ORDER_CONFIRM
Script:
<script type="text/javascript">
// primary function to retrieve cookie by name
function getPixelCookie(name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg) {
return getPixelCookieVal(j);
}
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
// utility function called by getCookie()
function getPixelCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1) {
endstr = document.cookie.length;
}
return unescape(document.cookie.substring(offset, endstr));
}
</script>
<script type="text/javascript">
// Get the value from the Cookie AFFILIATE_TRACKING
// If it exists and has not expired then
// depending on which Affiliate is identified generate
// an appropriate script
var AFFILIATE = getPixelCookie('AFFILIATE_TRACKING');
if (AFFILIATE)
{
if (AFFILIATE.toUpperCase() == 'ACME')
{
var _affiliate = [];
_affiliate.push(['ACME_ORDER_ID', '${ORDER_ID!}']);
_affiliate.push(['ACME_ORDER_ITEMS_QTY', '${ORDER_ITEMS_QTY!}']);
_affiliate.push(['ACME_ORDER_ITEMS_MONEY', '${ORDER_ITEMS_MONEY!}']);
_affiliate.push(['ACME_ORDER_TOTAL_PROMO', '${ORDER_TOTAL_PROMO!}']);
_affiliate.push(['ACME_ORDER_TOTAL_SHIP', '${ORDER_TOTAL_SHIP!}']);
_affiliate.push(['ACME_ORDER_TOTAL_TAX', '${ORDER_TOTAL_TAX!}']);
_affiliate.push(['ACME_ORDER_TOTAL_MONEY', '${ORDER_TOTAL_MONEY!}']);
}
if (AFFILIATE.toUpperCase() == ‘XYZ’)
{
var _affiliate = [];
_affiliate.push(['ABC_ORDER_ID', '${ORDER_ID!}']);
_affiliate.push(['ABC_ORDER_ITEMS_QTY', '${ORDER_ITEMS_QTY!}']);
_affiliate.push(['ABC_ORDER_ITEMS_MONEY', '${ORDER_ITEMS_MONEY!}']);
_affiliate.push(['ABC_ORDER_TOTAL_PROMO', '${ORDER_TOTAL_PROMO!}']);
_affiliate.push(['ABC_ORDER_TOTAL_SHIP', '${ORDER_TOTAL_SHIP!}']);
_affiliate.push(['ABC_ORDER_TOTAL_TAX', '${ORDER_TOTAL_TAX!}']);
_affiliate.push(['ABC_ORDER_TOTAL_MONEY', '${ORDER_TOTAL_MONEY!}']);
}
}
</script>
Pixel Tracking is stored in memory cache. Whenever you make modifications to scripts the cache will need to be reset.
To reset the cache use the Admin Tools
Reset Cache function.