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)
-   -   Google Conversion Tracking (https://forum.x-cart.com/showthread.php?t=5003)

successful 10-29-2003 04:20 PM

Google Conversion Tracking
 
Google recently released a conversion tracking tool. In order to use their tool you need to add the to your order confirmation/receipt page.

I edited the /customer/main/order_message.tpl template and added the following:


Code:

<script language="JavaScript">
<!--
google_conversion_id = 1072730847;
google_conversion_language = "en_US";
if ($order.total) {
  google_conversion_value = $order.total;
}
google_conversion_label = "Purchase";
-->
</script>
<script language="JavaScript" src="https://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<a href="https://services.google.com/sitestats/en_US.html" target=_blank>
[img]https://www.googleadservices.com/pagead/conversion/1072730847/?value=$order.total&label=Purchase&hl=en[/img]
</a>
</noscript>



I received the following error when I tried to place my order. Instead of the normal receipt page I received:

Fatal error: Smarty: [in customer/main/order_message.tpl line 29]: syntax error: invalid attribute name - '=' in /home/xcart/public_html/store/Smarty-2.3.0/Smarty_Compiler.class.php on line 1398



Anybody have any idea what I'm doing wrong and how I can correct this issue ?

Also, it would be nice to be able to use the order total without shipping charges included. Is this possible ?

successful 10-30-2003 07:52 AM

Nobody ? :(

dealsondeals 10-30-2003 08:13 AM

8O , Pardon me if this is a simplistic question,

You did wrap the javascript in {literal} {/literal} tags right?

Regards,

Glen

jpsowin 10-30-2003 09:09 AM

That would certainly do it...

groovico 10-30-2003 11:38 AM

Yeah you need do do it as a {literal} include but make sure you generate the right code for your site, i.e google does it for both http: and https://

You'll also find it sticks a silly image on your site too.

successful 11-03-2003 12:53 PM

Guys,

Sorry I'm not a programmer.....can you show me an example that would work for my site ?

TIA!

jpsowin 11-03-2003 01:18 PM

Code:

{literal}

<script language="JavaScript">
<!--
google_conversion_id = 1072730847;
google_conversion_language = "en_US";
if ($order.total) {
  google_conversion_value = $order.total;
}
google_conversion_label = "Purchase";
-->
</script>
<script language="JavaScript" src="https://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<a href="https://services.google.com/sitestats/en_US.html" target=_blank>
[img]https://www.googleadservices.com/pagead/conversion/1072730847/?value=$order.total&label=Purchase&hl=en[/img]
</a>
</noscript>
{/literal}


successful 11-03-2003 01:34 PM

Thanks...that was wayyy to easy ;-)


All times are GMT -8. The time now is 01:13 PM.

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