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

pasting pixel tracking code in template is changed by site

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-11-2013, 09:17 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default pasting pixel tracking code in template is changed by site

Hi,
I am trying to paste some javascript pixel tracking code at the bottom of skin/ideal_responsive/customer/home.tpl on my Version 4.6.0 site like this, when I post this code...

Code:
<script type="text/javascript"> adroll_adv_id = "xxxxxxxxxxxxxxxx"; adroll_pix_id = "xxxxxxxxxxxxxxxx"; (function () { var oldonload = window.onload; window.onload = function(){ __adroll_loaded=true; var scr = document.createElement("script"); var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com"); scr.setAttribute('async', 'true'); scr.type = "text/javascript"; scr.src = host + "/j/roundtrip.js"; ((document.getElementsByTagName('head') || [null])[0] || document.getElementsByTagName('script')[0].parentNode).appendChild(scr); if(oldonload){oldonload()}}; }()); </script>

on the page source it looks like this...

Code:
<script type="text/javascript"> adroll_adv_id = "xxxxxxxxxxxxxxxxxxxxxx"; adroll_pix_id = "xxxxxxxxxxxxxxxxxxxxxx"; (function () }; }()); </script>

with most of the code missing. Anyone know why this is happening and how to make it show up correctly?
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #2  
Old 09-11-2013, 09:38 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: pasting pixel tracking code in template is changed by site

You need to enclose it in {literal} tag for smarty to ignore it otherwise it is trying to interpret it

{literal}
code here
{/literal}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 09-11-2013, 09:47 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: pasting pixel tracking code in template is changed by site

Oh, that's right. I had been told that before and forgot about it. How would I go about adding defer loading? Or is there a better way to add this code so it gets cached with the other .js code on site?
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:34 PM.

   

 
X-Cart forums © 2001-2020