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)
-   -   Need help installing Overture Conversion Counter code (https://forum.x-cart.com/showthread.php?t=6749)

minorgod 02-23-2005 08:47 AM

Are you sure you've got your tracking ID properly substituted? Is it just overture you are having problems with or is it Google? You definitely want the code only in your order_message.tpl. It should not be on any other page.

cotc2001 02-23-2005 10:24 AM

On the note of overture, i noticed that i got a lot of mysql errors for some reason after enabling the advanced tracking on the overture control panel (the admin email contained the string from overture tracking)

eberghof 07-26-2006 11:35 PM

Still loking for where to place the overture tracking code
 
I've read many a post and still am not sure where to place the Overture tracking code in the order_message template for 4.0.XX.

Can someone please help?

minorgod 07-27-2006 08:06 AM

You can really place the Overture and Google code anywhere in the order_message.tpl file. Just forget about the <head> tags and just use everything between the <script></script> tags. For example, I have the following code at the very top of my order_message.tpl file with conditional statements so that it is only loaded if we are not in test mode and we are not looking at the printable version. Keep in mind that I'm using the 3.x branch of x-cart, but this should be very similar if not identical to what you would need to do.

Code:

{if $this_is_printable_version eq ""}
        {include file="location.tpl" last_location=$lng.lbl_order_processed last_url="cart.php"}
        {* assign a grand_total variable to hold the order total for advanced google conversion tracking by brett *}
        { if $test_mode != "Y" }
                {* assign var="grand_total" value="0" *}
                {literal}
                <SCRIPT LANGUAGE="JavaScript">
                <!-- Overture Services Inc. 07/15/2003
                var cc_tagVersion = "1.0";
                var cc_accountID = "ABC123-use-your-own-id-here";
                var cc_marketID =  "0";
                var cc_protocol="http";
                var cc_subdomain = "convctr";
                if(location.protocol == "https:")
                {
                        cc_protocol="https";
                    cc_subdomain="convctrs";
                }
                var cc_queryStr = "?" + "ver=" + cc_tagVersion + "&aID=" + cc_accountID + "&mkt=" + cc_marketID +"&ref=" +                escape(document.referrer);
                var cc_imageUrl = cc_protocol + "://" + cc_subdomain + ".overture.com/images/cc/cc.gif" + cc_queryStr;
                var cc_imageObject = new Image();
                cc_imageObject.src = cc_imageUrl;
                // -->
                </SCRIPT>
                {/literal}
        {/if}
        {capture name=dialog}
                <font class=ProductDetails>{$lng.txt_order_placed}</font>
                <font class=ProductDetails>{$lng.txt_order_placed_msg}</font>
        {/capture}
       

        {include file="dialog.tpl" title=$lng.lbl_confirmation content=$smarty.capture.dialog extra="width=100%"}
{/if}


Then just before the closing {/capture} tag on my template, I put the Google Adwords conversion code, so the bottom of my template looks like this:

Code:

       
        {if $test_mode != "Y"}
                <script language="JavaScript">
                <!--
                google_conversion_id = useryourownidhere;
                google_conversion_language = "en_US";
                grand_total = {$grand_total};
                {literal}
                        if (grand_total) {
                          google_conversion_value = grand_total;
                        }
                {/literal}
                google_conversion_label = "Purchase";
                -->
                </script>
                {literal}
                        <script language="JavaScript" src="https://www.googleadservices.com/pagead/conversion.js">
                {/literal}
                </script>
                <noscript>
                <a href="https://services.google.com/sitestats/en_US.html" target=_blank>
                [img]https://www.googleadservices.com/pagead/conversion/useryourownidhere/?value={$grand_total}&label=Purchase&hl=en[/img]
                </a>
                </noscript>
        {/if}
       
{/capture}
{include file="dialog.tpl" title=$lng.lbl_invoice content=$smarty.capture.dialog extra="width=100%"}


Also, if you're using cartlab's Google Analytics mod, you could include that in the section that loops over the order items like so:

Code:

{section name=oi loop=$orders}
                {include file="customer/main/order_message_header.tpl" products=$orders[oi].products giftcerts=$orders[oi].giftcerts userinfo=$orders[oi].userinfo order=$orders[oi].order}
                {include file="customer/main/order_message_product_data.tpl" products=$orders[oi].products giftcerts=$orders[oi].giftcerts userinfo=$orders[oi].userinfo order=$orders[oi].order}
                {include file="customer/main/order_message_customer_info.tpl" products=$orders[oi].products giftcerts=$orders[oi].giftcerts userinfo=$orders[oi].userinfo order=$orders[oi].order}
                {include file="customer/main/order_message_totals.tpl" products=$orders[oi].products giftcerts=$orders[oi].giftcerts userinfo=$orders[oi].userinfo order=$orders[oi].order}<hr size=1 noshade>
                {if $active_modules.Interneka ne ""}
                        { include file="modules/Interneka/interneka_tags.tpl" }
                {/if}
        {*** Google Analytics conversion tracking ***}
       
                {if $test_mode != "Y"}
                        {include file="g_analytics.tpl" products=$orders[oi].products order=$orders[oi].order}
                {/if}
       
        {*** END Google Analytics conversion tracking ***}
        {/section}


Hope that helps.

TL408 10-17-2006 10:42 AM

Re: Need help installing Overture Conversion Counter code
 
Do you know if this would work with X-cart 4.1.x release?

Thanks
-Tuan

Quote:

Originally Posted by minorgod
You can really place the Overture and Google code anywhere in the order_message.tpl file. Just forget about the <head> tags and just use everything between the <script></script> tags. For example, I have the following code at the very top of my order_message.tpl file with conditional statements so that it is only loaded if we are not in test mode and we are not looking at the printable version. Keep in mind that I'm using the 3.x branch of x-cart, but this should be very similar if not identical to what you would need to do.

Code:

{if $this_is_printable_version eq ""}
        {include file="location.tpl" last_location=$lng.lbl_order_processed last_url="cart.php"}
        {* assign a grand_total variable to hold the order total for advanced google conversion tracking by brett *}
        { if $test_mode != "Y" }
                {* assign var="grand_total" value="0" *}
                {literal}
                <SCRIPT LANGUAGE="JavaScript">
                <!-- Overture Services Inc. 07/15/2003
                var cc_tagVersion = "1.0";
                var cc_accountID = "ABC123-use-your-own-id-here";
                var cc_marketID =  "0";
                var cc_protocol="http";
                var cc_subdomain = "convctr";
                if(location.protocol == "https:")
                {
                        cc_protocol="https";
                    cc_subdomain="convctrs";
                }
                var cc_queryStr = "?" + "ver=" + cc_tagVersion + "&aID=" + cc_accountID + "&mkt=" + cc_marketID +"&ref=" +                escape(document.referrer);
                var cc_imageUrl = cc_protocol + "://" + cc_subdomain + ".overture.com/images/cc/cc.gif" + cc_queryStr;
                var cc_imageObject = new Image();
                cc_imageObject.src = cc_imageUrl;
                // -->
                </SCRIPT>
                {/literal}
        {/if}
        {capture name=dialog}
                <font class=ProductDetails>{$lng.txt_order_placed}</font>
                <font class=ProductDetails>{$lng.txt_order_placed_msg}</font>
        {/capture}
       

        {include file="dialog.tpl" title=$lng.lbl_confirmation content=$smarty.capture.dialog extra="width=100%"}
{/if}


Then just before the closing {/capture} tag on my template, I put the Google Adwords conversion code, so the bottom of my template looks like this:

Code:

       
        {if $test_mode != "Y"}
                <script language="JavaScript">
                <!--
                google_conversion_id = useryourownidhere;
                google_conversion_language = "en_US";
                grand_total = {$grand_total};
                {literal}
                        if (grand_total) {
                          google_conversion_value = grand_total;
                        }
                {/literal}
                google_conversion_label = "Purchase";
                -->
                </script>
                {literal}
                        <script language="JavaScript" src="https://www.googleadservices.com/pagead/conversion.js">
                {/literal}
                </script>
                <noscript>
                <a href="https://services.google.com/sitestats/en_US.html" target=_blank>
               
                </a>
                </noscript>
        {/if}
       
{/capture}
{include file="dialog.tpl" title=$lng.lbl_invoice content=$smarty.capture.dialog extra="width=100%"}


Also, if you're using cartlab's Google Analytics mod, you could include that in the section that loops over the order items like so:

Code:

{section name=oi loop=$orders}
                {include file="customer/main/order_message_header.tpl" products=$orders[oi].products giftcerts=$orders[oi].giftcerts userinfo=$orders[oi].userinfo order=$orders[oi].order}
                {include file="customer/main/order_message_product_data.tpl" products=$orders[oi].products giftcerts=$orders[oi].giftcerts userinfo=$orders[oi].userinfo order=$orders[oi].order}
                {include file="customer/main/order_message_customer_info.tpl" products=$orders[oi].products giftcerts=$orders[oi].giftcerts userinfo=$orders[oi].userinfo order=$orders[oi].order}
                {include file="customer/main/order_message_totals.tpl" products=$orders[oi].products giftcerts=$orders[oi].giftcerts userinfo=$orders[oi].userinfo order=$orders[oi].order}<hr size=1 noshade>
                {if $active_modules.Interneka ne ""}
                        { include file="modules/Interneka/interneka_tags.tpl" }
                {/if}
        {*** Google Analytics conversion tracking ***}
       
                {if $test_mode != "Y"}
                        {include file="g_analytics.tpl" products=$orders[oi].products order=$orders[oi].order}
                {/if}
       
        {*** END Google Analytics conversion tracking ***}
        {/section}


Hope that helps.


doersam@hotmail.com 01-24-2007 09:49 AM

Re: Need help installing Overture Conversion Counter code
 
I placed my Google conversion code, enclosed in literal tags - {literal} java code {/literal}, at the bottom of the customer/main/order_message.tpl and it works fine. I'm using version 4.1.5.


All times are GMT -8. The time now is 01:03 AM.

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