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

Need help installing Overture Conversion Counter code

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-17-2004, 10:28 PM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default Need help installing Overture Conversion Counter code

I have signed up for the Overture Conversion Counter and it requires adding a little JavaScript code in between the <head></head> tags, simple enough? The only place I know to add it is in the customer/home.tpl with the rest of my JS but it needs to be on the order confirmation page only.

Here is the JS code:
Code:
<SCRIPT LANGUAGE="JavaScript"> <!-- Overture Services Inc. 07/15/2003 var cc_tagVersion = "1.0"; var cc_accountID = "xxxxxxxxxx"; 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>

And the instructions they sent:
Code:
The tag must be placed on the transaction completion page of your Website. The tag must not be modified. Modification of the Overture tag will result in malfunction of the tag, including data loss or inaccurate collection of data. WHERE TO INSERT YOUR TAG To properly track a conversion, OvertureБ─≥s tagging technology must be placed on the transaction completion page. If the tag is placed on any other page, your conversion counts could be overstated. The Overture tag must be placed within the header of the HTML document between the <HEAD> (open header) and </HEAD> (close header) tags. Example of a basic HTML document using recommended tagging method <html> <head> <title>Sample HTML File</title> <SCRIPT LANGUAGE="JavaScript"> <!-- Overture Services Inc. 03/01/2003 var ov_tagVersion = "1.0.0"; var ov_accountID = "XXXX"; var ov_queryStr = "?" + "tv=" + ov_tagVersion + "&ai=" + ov_accountID + "&rf=" + escape(document.referrer); var ov_convImage = new Image(); ov_convImage.src = "//oa.overture.com/Conversion.gif" + ov_queryStr; // --> </SCRIPT> </head> <body> This is the content of your web page. </body> </html> HYPERTEXT PREPROCESSOR (PHP) SET UP INSTRUCTIONS OVERVIEW This section describes how to use PHP to get the tag written into your confirmation or thank you page. You will need to save the JavaScript code provided at signup time (or retrieved from DTC) to a file on your webserver and then include a small amount of PHP script in the HEAD section of your html. INSTRUCTIONS Step 1 Save the JavaScript provided to you as a file, in this example Б─°overture_cc.jsБ─² Step 2 Place this file on your webserver, in a location of your choice, for example Б─°/javascript/overture_cc.jsБ─² Step 3 Edit your confirmation or thank you page to include the following PHP script <?PHP $filename = Б─°javascript/overture_cc.jsБ─²; $fp = fopen($filename,Б─≥rБ─≥); if ($fp) { $js = fread($fp,filesize($filename)); echo($js); fclose($fp); } <?> Important The value supplied to the filename variable in the script shown above is dependent on threeitems: 1) what you named the JavaScript file supplied to you by Overture 2) where you place the JavaScript file supplied to you by Overture 3) The location of the JavaScript file relative to the location of your confirmation or thank you page template. As shown in the above example, there is a directory or folder named Б─°javascriptБ─² that is in the same directory as the confirmation or thank you page, and inside that folder there is a file named overture_cc.js. Please consult your webmaster if you are not sure of how to implement this approach.



Any help with this is much appreciated!

The site this is going on is x-cart 3.4.11
__________________
Web site design - Custom Programming - Upgrades - Marketing
www.netvisionwebdesign.com

Follow on twitter: http://twitter.com/netvisionweb
Become a fan on Facebook: http://www.facebook.com/pages/NetVision-Web-Design/89463493419
Reply With Quote
  #2  
Old 03-18-2004, 03:46 AM
  shan's Avatar 
shan shan is offline
 

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

Default

make sure you wrap the java code in literal tags

{literal} java code {/literal}
__________________
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 03-19-2004, 12:47 AM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default

Where, or how could I put the code so it is placed in between the <head></head> tags on the confirmation page only?

As the instruction say, it needs to be on the confirmation page only or else it will reports inaccurate information.

Could this maybe be done with a include in the .php file? and is there and easy way to do this?

Thanks!
__________________
Web site design - Custom Programming - Upgrades - Marketing
www.netvisionwebdesign.com

Follow on twitter: http://twitter.com/netvisionweb
Become a fan on Facebook: http://www.facebook.com/pages/NetVision-Web-Design/89463493419
Reply With Quote
  #4  
Old 03-20-2004, 07:57 PM
 
bcr bcr is offline
 

Newbie
  
Join Date: Dec 2003
Posts: 2
 

Default

I would think you would put it in the main/order_message.tpl file. Something like this:

Code:
{literal} <head> <SCRIPT LANGUAGE="JavaScript"> <!-- Overture Services Inc. 07/15/2003 var cc_tagVersion = "1.0"; var cc_accountID = "xxxxxxxxxx"; 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> </head> {/literal}
Reply With Quote
  #5  
Old 03-22-2004, 10:07 PM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default

wouldn't this just be adding Head tags to this template essentially putting in 2 sets of Head tags on the final outputed page that the customer sees?
__________________
Web site design - Custom Programming - Upgrades - Marketing
www.netvisionwebdesign.com

Follow on twitter: http://twitter.com/netvisionweb
Become a fan on Facebook: http://www.facebook.com/pages/NetVision-Web-Design/89463493419
Reply With Quote
  #6  
Old 03-25-2004, 06:07 AM
 
eleven eleven is offline
 

Senior Member
  
Join Date: Nov 2002
Location: Charlotte, NC, USA
Posts: 118
 

Default That didn't work

I didn't think that having two <Head> sections would work. I tried it earlier this week but it didn't work. Google's conversion code worked on that page though.

I don't know if this will work, but this is what I did. In skin/customer/home.tpl in inserted the following code right above the closing </head> tag.
Code:
{if $main eq "order_message"} {literal} <SCRIPT LANGUAGE="JavaScript"> var cc_tagVersion = "1.0"; var cc_accountID = "111111"; 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}

Thoughts? Does anyone have another way?
__________________
|| E L E V E N ||
Reply With Quote
  #7  
Old 03-25-2004, 10:12 AM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default

eleven...
This is about what I was thinking, I have put the code in and will be testing it a little later today. I will post the results when i'm done...

Thanks for the assist!
__________________
Web site design - Custom Programming - Upgrades - Marketing
www.netvisionwebdesign.com

Follow on twitter: http://twitter.com/netvisionweb
Become a fan on Facebook: http://www.facebook.com/pages/NetVision-Web-Design/89463493419
Reply With Quote
  #8  
Old 04-01-2004, 08:11 AM
 
blue-dreamer blue-dreamer is offline
 

eXpert
  
Join Date: Dec 2002
Location: Northampton UK
Posts: 213
 

Default

Any update on this one? I've got a customer who's just signed up for Overture...
Reply With Quote
  #9  
Old 04-02-2004, 12:55 PM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default Track both Google and Overture

I don't think it matters where you put the Overture code. From looking at the code, it should work anywhere in your order_message.tpl. I have gotten both Overture and advanced Google conversion code. It has been working fine for us within the body of the page. Here's what my order_message.tpl looks like, but keep in mind this is from X-Cart 3.3.x branch and I have taken the liberty of removing our tracking IDs from this code and replaced with "your_tracking_id_here":

Code:
{* $Id: order_message.tpl,v 1.18 2002/10/17 13:54:56 zorg Exp $ *} {* assign a grand_total variable to hold the order total for advanced google conversion tracking by brett *} {assign var="grand_total" value="0"} {literal} <SCRIPT LANGUAGE="JavaScript"> <!-- Overture Services Inc. 07/15/2003 var cc_tagVersion = "1.0"; var cc_accountID = "your_tracking_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} {include file="location.tpl" last_location=$lng.lbl_order_processed last_url="cart.php"} {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%"} {capture name=dialog} {section name=oi loop=$orders} <pre> <font> {include file="mail/order_invoice.tpl" products=$orders[oi].products giftcerts=$orders[oi].giftcerts userinfo=$orders[oi].userinfo order=$orders[oi].order} </font> </pre> <hr size=1 noshade> {assign var="temp_order" value="$orders[oi].order} {assign var="grand_total" value=$temp_order[total]+$grand_total} {/section} <script language="JavaScript"> <!-- google_conversion_id = your_tracking_id_here; 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/1234567890/?value={$grand_total}&label=Purchase&hl=en[/img] </a> </noscript> {/capture} {include file="dialog.tpl" title=$lng.lbl_invoice content=$smarty.capture.dialog extra="width=100%"}

For overture, I just pasted the code inside some literals. For Google, I'm just doing a loop throught the orders and totaling them with Smarty, then substituting the $grand_total into the Google Javascript code. This way you can track the actual value of each conversion in Google. I just upgraded to this advanced tracking today, so the code isn't tested yet, but it should work fine.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote
  #10  
Old 02-22-2005, 04:35 PM
  enterfusion's Avatar 
enterfusion enterfusion is offline
 

Advanced Member
  
Join Date: Mar 2004
Location: Pittsburg, CA
Posts: 70
 

Default Placed in the home.tpl would give you incorrect results...

If you place this code in the home.tpl your conversions would be way off, since everything calls that tpl file, you need to place it in the order_message.tpl file, but I have not gotten it to give me any results there, even though I have no javascript errors and it DOES show up in the source on that page, anyone have any ideas?

-Eric

Running X-cart 3.5.5
www.chirunning.com
__________________
-Eric

X-cart 4.3.2 up and running.
Apache, PHP 5.2, APC, Redhat, Checkout One, On Sale, Smart Search, Remember Cart.
Lots of other customization's, but perhaps typical of x-cart installations.

X-cart 5 sort of in limbo, trying to make things work without much luck.
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:54 PM.

   

 
X-Cart forums © 2001-2020