Where to add "Google Code for Checkout Success Conversion Page" for Version 2.1.1

hello ,



i search around for any posts about where to add “Google Code for Checkout Success Conversion”,because i use google adwords ,i need to konw how many conversions for my payment. But all information seems overtime ,because CS cart has issued its latest version of V2.1.1 .



So wonder ,can i creat a block under design–blocks–order landing page,and put the “Google Code for Checkout Success Conversion” in it ? Will it work ? If not ,where exactly should i put the code ?



thank you very much for any response. I`m use V2.1.1 .



----------------------------------------------

Below is the google code :









Click on ‘Track eCommerce’ from the Google Analytics

plugin → Administration → Addons → Google Analytics (edit)

dear JesseLee,thank you very much for your response.



But you know,but you know,my adwords specialist give me 3 codes:

1,google analytics code,i can find my account number like UA-xxxxxx-x,i can put it directly in Administration → Addons → Google Analytics (edit)



2,i also get checkout success code,where i can find my ID,the code means,the client may successfully put us the order,but may fail to do the payment .



3,i also have payment success code,where i can find my ID same as above,the code means the client has successfully send the payment.



So ,under Administration → Addons → Google Analytics (edit),there is only a select to check or uncheck “Track e-commerce transactions” .If i check the box,will above 2 and 3 work ? Do the CS CART can identify my ID according to the analytics account from 1 ?



Below are my codes about 2 and 3:

Checkout success:

<!-- Google Code for Checkout Success Conversion Page --><br />
<script type="text/javascript"><br />
/* <![CDATA[ */<br />
var google_conversion_id = 123456789;<br />
var google_conversion_language = "en";<br />
var google_conversion_format = "2";<br />
var google_conversion_color = "ffffff";<br />
var google_conversion_label = "X_ItCPKz7wEQxoah3AM";<br />
var google_conversion_value = 0;<br />
if (<%= totalValue %>) {<br />
  google_conversion_value = <%= totalValue %>;<br />
}<br />
/* ]]> */<br />
</script><br />
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"><br />
</script><br />
<noscript><br />
<div style="display:inline;"><br />
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/123456789/?value=<%= totalValue %>&label=X_ItCPKz7wEQxoah3AM&guid=ON&script=0"/><br />
</div><br />
</noscript><br />

```<br />
<br />
Payment success<br />
```php
<!-- Google Code for success Conversion Page --><br />
<script type="text/javascript"><br />
/* <![CDATA[ */<br />
var google_conversion_id = 123456789;<br />
var google_conversion_language = "en";<br />
var google_conversion_format = "2";<br />
var google_conversion_color = "ffffff";<br />
var google_conversion_label = "tGZxCJKE7QEQxoah3AM";<br />
var google_conversion_value = 0;<br />
/* ]]> */<br />
</script><br />
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"><br />
</script><br />
<noscript><br />
<div style="display:inline;"><br />
<img height="1" width="1" style="border-style:none;" alt="" src="upload://ux1zSLp9vBY9KEUw7CSvZVrESee.gif"><br />
</div><br />
</noscript><br />

[quote name=‘anykeeper’]dear JesseLee,thank you very much for your response.



But you know,but you know,my adwords specialist give me 3 codes:

1,google analytics code,i can find my account number like UA-xxxxxx-x,i can put it directly in Administration → Addons → Google Analytics (edit)



2,i also get checkout success code,where i can find my ID,the code means,the client may successfully put us the order,but may fail to do the payment .



3,i also have payment success code,where i can find my ID same as above,the code means the client has successfully send the payment.



So ,under Administration → Addons → Google Analytics (edit),there is only a select to check or uncheck “Track e-commerce transactions” .If i check the box,will above 2 and 3 work ? Do the CS CART can identify my ID according to the analytics account from 1 ?



Below are my codes about 2 and 3:

Checkout success:

<!-- Google Code for Checkout Success Conversion Page --><br />
<script type="text/javascript"><br />
/* <![CDATA[ */<br />
var google_conversion_id = 123456789;<br />
var google_conversion_language = "en";<br />
var google_conversion_format = "2";<br />
var google_conversion_color = "ffffff";<br />
var google_conversion_label = "X_ItCPKz7wEQxoah3AM";<br />
var google_conversion_value = 0;<br />
if (<%= totalValue %>) {<br />
  google_conversion_value = <%= totalValue %>;<br />
}<br />
/* ]]> */<br />
</script><br />
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"><br />
</script><br />
<noscript><br />
<div style="display:inline;"><br />
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/123456789/?value=<%= totalValue %>&label=X_ItCPKz7wEQxoah3AM&guid=ON&script=0"/><br />
</div><br />
</noscript><br />

```Payment success<br />
```php
<!-- Google Code for success Conversion Page --><br />
<script type="text/javascript"><br />
/* <![CDATA[ */<br />
var google_conversion_id = 123456789;<br />
var google_conversion_language = "en";<br />
var google_conversion_format = "2";<br />
var google_conversion_color = "ffffff";<br />
var google_conversion_label = "tGZxCJKE7QEQxoah3AM";<br />
var google_conversion_value = 0;<br />
/* ]]> */<br />
</script><br />
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js"><br />
</script><br />
<noscript><br />
<div style="display:inline;"><br />
<img height="1" width="1" style="border-style:none;" alt="" src="upload://ux1zSLp9vBY9KEUw7CSvZVrESee.gif"><br />
</div><br />
</noscript><br />

```[/quote]<br />
<br />
This is different to Google Analytics - You wish to know how to place the Google Adwords Order Conversion script into your store.<br />
<br />
ie Know how many keywords create orders + the CPC for each?

Put it in the file:

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



Analytics is different from the ad-words conversion tracking (usually has separate ID’s since you can have multiple conversion id’s for the same store). For conversion tracking, do the above.



You will want to replace the following:

<%= totalValue %> with {$order_data.total}



Clear the cache when you’re done.

[quote name=‘JesseLeeStringer’]This is different to Google Analytics - You wish to know how to place the Google Adwords Order Conversion script into your store.



ie Know how many keywords create orders + the CPC for each?[/QUOTE]



Dear Jesse ,yes you are right. I need to place the google Adwords order conversion. Thank you for all your help.

[quote name=‘tbirnseth’]Put it in the file:

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



Analytics is different from the ad-words conversion tracking (usually has separate ID’s since you can have multiple conversion id’s for the same store). For conversion tracking, do the above.



You will want to replace the following:

<%= totalValue %> with {$order_data.total}



Clear the cache when you’re done.[/QUOTE]



dear ,thank you for your help.

im useing the latest V2.1.1 ,do you mean i need to creat new folder and new file under addons for "my_changes/hooks/orders/confirmation.post.tpl" .I dont know where the confirmation.post.tpl is .Could you pls explain ?



thank you very much.

This is called adding a hook.

Create the path of directories.

Then create the file with your code in it with the suggested replacement above.

dear tbirnseth,thank you very much.

i have done this,will come back very soon.

No problem. I have not looked specifically at 2.1 (this was from 2.0). I certainly hope that they didn’t move/rename a hook that merchants would use for order confirmation code for 3rd parties.

[quote name=‘tbirnseth’]No problem. I have not looked specifically at 2.1 (this was from 2.0). I certainly hope that they didn’t move/rename a hook that merchants would use for order confirmation code for 3rd parties.[/QUOTE]



dear,i have tried this,but its unlucky,my google adwords rep told me its not working. so i`ll need to find out any other ways.



thank you anyway.

Actually I did idscover that they changed the hook name/location in 2.1.x It is now called “checkout:confirmation” versus “order:confirmation”. Hence, if you have this hooked in 2.0, you will need to copy the file to skins//customer/addons/my_changes/hooks/catalog/confirmation.post.tpl…



So nice of them to do so. Guess hooks won’t be as portable as intended. Could just have easily left it alone and just moved it from the views/orders/details.tpl to views/checout/complete.tpl and it wouldn’t have broken anything (or any other addons that use this).

dear,i understand now,there is a instruction from cs cart knowledge base,check here : [url]CS-Cart Documentation — CS-Cart 4.15.x documentation



but while i finished configuration, when i put an order for testing,it shows below words on my order info page.



```php Fatal error: Smarty error: [in addons/my_changes/hooks/checkout/order_confirmation.override.tpl line 10]: syntax error: unrecognized tag ‘google_conversion_value’ (Smarty_Compiler.class.php, line 589) in /home/eeqeee/public_html/erqreqee/lib/templater/Smarty.class.php on line 1095 ```



While my google conversion code is :

```php








```

Enclose your code within {literal} tags. It is failing when it sees the opening ‘{’.



So put

{literal}

at the top of the code

and

{/literal}

at the end.

dear tbirnseth,could you pls do me a favor?



i use CS CART V2.1.2 , i did the same as [url]CS-Cart Documentation — CS-Cart 4.15.x documentation ,and i put my google code between {literal} and {/literal},but still i can`t find any information in GOOGLE convertion after my testing. Do i made any mistake ?

Suggest you do a “view source” when you reach the dispatch=checkout.completion page when submitting a test order. You should see your google code on that page. You might want to include a comment in your order_confirmation.post.tpl file of soething like:



Just makes a search of the page easier....

dear,it works if i insert the code directly to root/skins/yourskin/customer/views/checkout/complete.tpl .



because i dont know where the file of "order_confirmation.post.tpl" is ,if i creat this file,are you sure it should be with name of "order_confirmation.post.tpl" ? so i dont want to put this addon.

If you create the file skins//customer/addons/my_changes/hooks/checkout/order_confirmation.post.tpl and put your code in there it will become part of the complete.tpl page by use of the {hook name=“checkout:order_confirmation”} hook.

dear,but cs cart ask to creat the file “order_confirmation.override.tpl” ,waht`s the difference between 2 file names?

Remember that the “My Changes” plug-in must also be activated :wink: