Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Google PPC Conversion Tracking Rate Topic   - - - - -

 
  • ian-d
  • Member
  • Members
  • Join Date: 19-Aug 07
  • 108 posts

Posted 21 August 2007 - 03:41 PM #1

Having looked high and low on the forum i cannot find an answer. I use google adwords for PPC advertising and would like to add the script code to the 'order confirmation' page so that google knows which have converted from ads/keywords i run with them.

I have no idea where to place the code. Does anyone have any idea which tpl it is, and where abouts within the tpl i should place it???

 
  • xmivite
  • Senior Member
  • Members
  • Join Date: 25-Jul 07
  • 101 posts

Posted 21 August 2007 - 06:04 PM #2

I think this is the order_details.tpl Try it, let me know. I need to do this too

 
  • bpaulette
  • Senior Member
  • Members
  • Join Date: 22-Feb 07
  • 156 posts

Posted 21 August 2007 - 07:14 PM #3

Just do a forum search on "Google Analytics" - there are a ton of threads about this
----------------------------
CS-Cart v. 1.3.4 sp2

Dell PowerEdge Servers and Server Parts & Accessories

 
  • ian-d
  • Member
  • Members
  • Join Date: 19-Aug 07
  • 108 posts

Posted 21 August 2007 - 10:14 PM #4

...i know, and none of them answer the question, they all give suggestions followed by a 'it doesnt work' response!

Anyone else?

 
  • bpaulette
  • Senior Member
  • Members
  • Join Date: 22-Feb 07
  • 156 posts

Posted 22 August 2007 - 08:53 PM #5

Try this. On order_details.tpl, put the tracking code in place like this

...
{/if}
{/capture}
{include file="common_templates/mainbox.tpl" title=$lang.order_info content=$smarty.capture.mainbox}
{/if}

{if $settings.Modules.discussion == 'Y'}
{include file="addons/discussion/discussion.tpl" object_id=$order_info.order_id object_type="O" title=$lang.discussion_title_order}
{/if}

{if $smarty.get.confirmation == 'Y' && $order_info.status == 'P'}
{* place any code you wish to display on this page right after the order has been placed *}
[COLOR="Red"]{* START Google E-Commerce Tracking *}
 
{if $current_location == $https_location}
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript">
{else}
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
{/if}
</script>
<script type="text/javascript">
_uacct = "UA-1234567-1";
urchinTracker();
</script>
<form style="display:none;" name="utmform">
<textarea id="utmtrans">
UTM:T|{$order_info.order_id}|{$settings.Company.company_name}|{$order_info.total}|{$order_info.taxed_subtotal}|{$order_info.shipping_cost}|{$order_info.b_city}|{$order_info.b_state}|{$order_info.b_country}
{$UTM_I}
</textarea>
</form>
<script language="text/javascript">__utmSetTrans();</script>
{* END Google E-Commerce Tracking *}[/COLOR]
{/if}

Now, I did modify the "if" so that it would only track "Processed" orders (our sales reps generate quotes from the site frontend - didn't want those tracked)... I believe the default file's original line was {if $smarty.get.confirmation == 'Y'} - so don't let that confuse you.

Hope that helps.
----------------------------
CS-Cart v. 1.3.4 sp2

Dell PowerEdge Servers and Server Parts & Accessories

 
  • ian-d
  • Member
  • Members
  • Join Date: 19-Aug 07
  • 108 posts

Posted 22 August 2007 - 09:47 PM #6

Thanks for the effort but that basically makes the checkout fail on confirmation as it doesn't understand my code. The code you have above is completely different than the one i use from google adwords for tracking conversions, it is just script without () etc.

My code is:


<!-- Google Code for purchase Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = XXXXXXXXXX;
var google_conversion_language = "en_GB";
var google_conversion_format = "1";
var google_conversion_color = "FFFFFF";
if (1) {
  var google_conversion_value = 1;
}
var google_conversion_label = "purchase";
//-->
</script>
<script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height=1 width=1 border=0 src="http://www.googleadservices.com/pagead/conversion/XXXXXXXXXX/imp.gif?value=1&label=purchase&script=0">
</noscript>


and it errors on the 'IF' statement!

 
  • ian-d
  • Member
  • Members
  • Join Date: 19-Aug 07
  • 108 posts

Posted 24 August 2007 - 04:39 PM #7

Any ideas from anyone where to place the above code? I just needs to be on the order confirmation page, but doesn't seem to work where others have suggested as the code is different!

 
  • paulesport
  • Senior Member
  • Members
  • Join Date: 23-Aug 07
  • 144 posts

Posted 16 November 2007 - 05:19 AM #8

anyone figure this out yet?

 
  • ian-d
  • Member
  • Members
  • Join Date: 19-Aug 07
  • 108 posts

Posted 16 November 2007 - 08:09 AM #9

Yep,

In order to add these scripts you should open the "order_details.tpl" file located in the "skins/[CUSTOMER_ACTIVE_SKIN]/customer/orders_pages" directory and add the following part of code:

{literal}
<!-- Google Code for purchase Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = XXXXXXXXXX;
var google_conversion_language = "en_GB";
var google_conversion_format = "1";
var google_conversion_color = "FFFFFF";
if (1) {
  var google_conversion_value = 1;
}
var google_conversion_label = "purchase";
//-->
</script>
<script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height=1 width=1 border=0 src="http://www.googleadservices.com/pagead/conversion/XXXXXXXXXX/imp.gif?value=1&label=purchase&script=0">
</noscript>
{/literal}

below this one:

{if $smarty.get.confirmation == 'Y'}
{* place any code you wish to display on this page right after the order has been placed *}

Save the file.

 

Posted 21 November 2007 - 05:11 PM #10

http://forum.cs-cart...read.php?t=4917

 
  • ian-d
  • Member
  • Members
  • Join Date: 19-Aug 07
  • 108 posts

Posted 21 November 2007 - 05:16 PM #11

So you've just linked to exactly what i've described above!?!?!

 

Posted 21 November 2007 - 07:10 PM #12

No, your instructions does not include the variable value for the sale total. The change I made to the code is dynamic with each sale.

Sorry, just tring to help the people that would like to use the sale total, instead of a static value of "1.0"

It is also nice when the threads are link to one another, so you do not spend all day reading through threads that are not helpful.

Your thread was very helpful getting me on the right path......

Thanks

 
  • ian-d
  • Member
  • Members
  • Join Date: 19-Aug 07
  • 108 posts

Posted 21 November 2007 - 07:15 PM #13

No probs, my post might have come across a bit rude but it was confusion rather than being inpolite, i missed the advance bit.

What is advanced tracking btw, do you mean instead of saying 'conversions = 2' it would say 'conversions = £402.44' for example?

 

Posted 21 November 2007 - 07:34 PM #14

Yes, I use it to help determine my ROI for each keyword. The total of the sale is important information, I have many keywords that get lots of clicks. Some keywords or phrases actually convert to higher total sales than others. I usaully keep the best performers and let the competition have the small sales.

 
  • raizscanlon
  • Junior Member
  • Members
  • Join Date: 16-Nov 08
  • 8 posts

Posted 06 January 2009 - 04:06 AM #15

Thanks Guys - I was looking for how to implement the Google Conversion Code (kept getting smarty errors and figured I must need something extra) and this little dynamic add-on is exactly what everyone needs to track at the keyword level for ROI - thanks again!

Robert

EDIT: Ooops - actually credit for the dynamic elements must go to this thread also referenced above - very very helpful:

http://forum.cs-cart...read.php?t=4917

 
  • Offline
  • Member
  • Members
  • Join Date: 13-Oct 09
  • 85 posts

Posted 30 April 2010 - 09:00 PM #16

{$order_info.subtotal} is this a better code to use that doesn't include shipping?

Thanks!
Chris Edwards