Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Where to put a Tracking Script

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-03-2004, 09:30 AM
 
bntfly bntfly is offline
 

Newbie
  
Join Date: Jun 2004
Posts: 2
 

Default 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>
Reply With Quote
  #2  
Old 06-03-2004, 09:54 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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

check http://smarty.php.net for more info on how to use javascript in smarty templates
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 06-03-2004, 12:19 PM
 
bntfly bntfly is offline
 

Newbie
  
Join Date: Jun 2004
Posts: 2
 

Default

Great! Thank you very much for the pointers!
That made my day!!!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:29 PM.

   

 
X-Cart forums © 2001-2020