Inserting Google conversion tracking code in new vision red skin

Hi,

I am trying to implement the Google conversion tracking code suggested in Dosterberger’s thread [URL=“http://forum.cs-cart.com/showthread.php?t=4917”]http://forum.cs-cart.com/showthread.php?t=4917[/URL] but when I check my orders.tpl file, there is no line of code as {if $smarty.get.confirmation == 'Y} where I can replace and insert the conversion code.



I am using the new_vision_red skin. Can anybody guide me where I can place the google adwords conversion code ?:confused:



Any help will be appreciated.



Thnx in advance.

If your cs-cart is 2.x, you can add your google code here:



\skins\new_vision_red\customer\views\orders\details.tpl



line 230:

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



The thread you mention above is in cs-cart 1.3.5, forget it and according to mine.

Thnx wayne. I got it working in version 1.3.5. Its actually under order_details.tpl.

[quote name=‘Wayne’]If your cs-cart is 2.x, you can add your google code here:

\skins\new_vision_red\customer\views\orders\details.tpl

line 230:

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

[/QUOTE]



Thanks much! Helped tremendously!

hm…



after I put this Google conversion code:

[HTML]







[/HTML]

CS-Cart say:
```php Fatal error: Smarty error: [in views/orders/details.tpl line 620]: syntax error:
unrecognized tag 'google_conversion_value' (Smarty_Compiler.class.php, line 589) in
/home/feelflow/public_html/lib/templater/Smarty.class.php on line 1095 ```

you require



{literal}

YOUR CODE

{/literal}

So where exactly do I put the conversion code?



Here maybe?: {/hook}



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

{hook name=“orders:confirmation”}

{/hook}



Do I put the code where it says: place any code you wish to display on this page right after the order has been placed



Please help me out here because this is really confusing stuff.



Thanks

Anybody?



I’d really appreciate the help.



Thanks

I use Google Checkout as my payment processor so adding this conversion code would it really benefit me?



I wanted to add the conversion code because I use adwords to advertise and I wanted to see how many conversions I was getting from them.



I’m sorry for posting so many times but this is a very crucial step since it’s costing a lot of money advertising with adwords.

So nobody knows anything about this?



Could someone please help me out?

I put mine in the “order success” template, at the bottom of /store/skins/[COLOR=“Blue”]your_skin_name[/COLOR]/customer/views/checkout/complete.tpl. It would look something like this:


{capture name="mainbox_title"}{$lang.order}{/capture}

{literal}
[COLOR="Blue"]{* Paste your Google code here *}[/COLOR]
{/literal}

add your code to the file:

skins//customer/addons/my_changes/hooks/orders/confirmation.post.tpl

and the code will be included on the dispatch=order.details page



You might have to create the path leading to the above file and you might have to clear your cache for the changes to be picked up.



When you run a test order and get to the dispatch=order.details page, do a “view source” to confirm that your changes are present.

I saw that, and would much prefer to use a hook, but I do NOT see the order details page when my checkout process is over. Is that weird? Maybe it’s because I’m using version 2.1.1?



In any case, this is template …/views/checkout/complete.tpl, and it doesn’t have any hooks, so that’s why I did mine via copy/paste. Any thoughts?

Screen shot 2010-09-16 at 3.25.40 PM.jpg

I haven’t walked this through wtih 2.1. Can you telll me what the URL is that is in the address bar when you get to the page (image you provded)?



I need to address a similar issue related to my co_fail addon in 2.1 so would be happy to review and recommend.

I have SEO on, so the URL is “checkout”. :slight_smile: Unhelpful, I know. With SEO off, the URL I see on order completion is:

…index.php?dispatch=checkout.complete&order_id=2513



The order details screen disappeared in the conversion from 2.0.15 → 2.1.0, so I just assumed this “complete.tpl” screen is their new method of doing things.

Well, as far as I can see, it doesn’t appear that they provide a means to put user supplied conversion scripts in 2.1… So what I would probably do is add

{hook name=“orders:confirmation”}{/hook}

just above the {capture} at the end of the file in complete.tpl. If you wanted to use a different name other than ‘confirmation’ (like ‘order_complete’) is might be clearer.



Not sure where they are expecting to have conversion scripts run in 2.1 upon the successful completion of an order since views/orders/details.tpl requires a specific button click in 2.1.



Also, if you keep the name as ‘confirmation’, thenb in your confirmation.post.tpl file I would bracket your scripts within

{if $controller != “orders”}

Your_scripts_here

{/if}

Does that if $controller != “orders” keep it from running conversion script in order managment area, I presume?

Under 2.0.x, at the completion of checkout, the orders.details page is called with a paramater of ‘confirmation=Y’. The hook named ‘orders:confirmation’ is dependent upon $_REQUEST[‘confirmation’] == ‘Y’. (I will leave the logic of calling an order details page at the end of checkout to you)



So it’s probably not necessary to add the condition.



Best practice would probably be to simply change the name in checkout.complete to “checkout:confirmation” (rather than “orders:confirmation”). Then the files will be separate even if they contain duplicate information.



Of course, I will almost guarantee that if cs-cart ever fixes this they will use some other name for the hook and your code will break then anyway! :slight_smile:

Using this code:



var google_conversion_value = {$order_info.total};



Tracks the order total for Google Conversion Tracking purposes.

Latest instructions… [url]CS-Cart Documentation — CS-Cart 4.15.x documentation