X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Where to put a Tracking Script (https://forum.x-cart.com/showthread.php?t=7889)

bntfly 06-03-2004 09:30 AM

Where to put a Tracking Script
 
Hello,
I am trying to add a third party tracking script to my site. I paste the cript to skin1/customer/home.tpl and then the cart errors out on me.
I place the script between </table> and </body> tags.
I also tried to put "{*" before and "*}" after the script but then it won't track the hits.
Any Ideas? Maybe a different template?
Here is the script:

Code:

<script language="javascript">
var data,nhp,ntz,rf,sr;
rf=document.referrer;
sr=document.location.search;

var referrer = document.referrer.split("://");
if (referrer.length>1) referrer = referrer[1]; else referrer = referrer[0];
if (referrer.split('/')[0] == document.domain)
    referrer = referrer.substring(referrer.indexOf('/'),referrer.length);


ntz=new Date();
nhp=location.protocol;

if (nhp != "http:" && nhp != "https:")
    nhp = "http:";

data='&appName=' + escape(navigator.appName)
    + '&cookieEnabled=' + navigator.cookieEnabled
    + '&systemLanguage='+escape(navigator.systemLanguage)
    + '&appVersion='+escape(navigator.appVersion)
    + '&userLanguage='+escape(navigator.userLanguage)
    + '&platform='+escape(navigator.platform)
    + '&referrer='+escape(referrer)
    + '&pathname='+escape(location.pathname+location.search);
   
if(navigator.appVersion.substring(0,1)>'3')
{
    data=data
        + '&colorDepth=' + screen.colorDepth
        + '&screenResolution='+escape(screen.width + ' x '+screen.height)
        + '&timezoneDiff='+ntz.getTimezoneOffset()
        + '&javaEnabled='+ navigator.javaEnabled()
};
document.write('<img border=0 hspace=0 '
                + 'vspace=0 width=1 height=1 src="'
                + nhp+'//www.s-tracking.com/tracking/'
                + 'track.php?campaignId=13014'+data+'">');
</script>
<script language="javascript1.2">
    document.write('<');
    document.write('!--  ');
</script>
<noscript>
    [img]http://www.s-tracking.com/tracking/track.php?campaignId=13014[/img]
</noscript>


shan 06-03-2004 09:54 AM

wrap the code in {literal}{/literal} tags

check http://smarty.php.net for more info on how to use javascript in smarty templates

bntfly 06-03-2004 12:19 PM

Great! Thank you very much for the pointers!
That made my day!!! :D


All times are GMT -8. The time now is 07:06 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.