Jump to content

[SOLUTION] How to make Google Adwords Conversions work with PayPal (UPDATE 2)


Recommended Posts

I see a lot of threads here about how to make Google Adwords Conversions (and Google Analytics if connected) work with PayPal but no solution which will work for 100% was posted yet even thought it is quite simple:

Open modules/paypal/standard/redirect.tpl or modules/paypal/redirect.tpl (depends on PayPal module version) and add the code in attached file before </body> tag:
(IMPORTANT: replace XXXXXXXX with your Google Conversion ID - you can get one in your Google AdWords Account under Reports - Conversions.

Save, close and upload to your FTP (test purchase is also recommended to make sure you did everything correctly).

Now all your purchases via PayPal which came via AdWords will shown in Google Adwords as conversion and the conversion value will correspond to order total cost in your store (NOTE: code you see above is not ready for multiple currencies - it means 10 EUR and 10 USD will be counted as the same value, but with little changes other currencies may be added).

NOTE: This will not work if you are using PayPal API credentials (but it does not break anything).

Feedback is welcome!

UPDATE 1: It is also recommeded to replace:

$(document).ready(function() {


with

$(window).load(function() {



(it will ensure code is executed)

UPDATE 2: Dynamic HTTP & HTTPS support added

paypal-conversion.txtFetching info...

Link to comment
Share on other sites

This code will properly records AdWords conversions (orders made by customers which came to your site via AdWords).

I am not sure if you know how AdWords conversion code works, but its code NEED to be executed by every single customer when making an order (AdWords then detect whether it is a AdWords conversion or not).

Link to comment
Share on other sites

  • 2 weeks later...

It will work. You will need to place the code to modules/cashondelivery/validation.tpl file and replace $amount with $total.

The better would be to place the code to modules/cashondelivery/confirmation.tpl file but with no extra modifications there is no way how to get amount paid ($total var is not available there).

However, COD is offline payment method. I am not sure if stats data you get will show the reality...

Link to comment
Share on other sites

Thanks, inveostore, very much!

So, I am using two modules for payments 1) bankwire (files payment.php or payment.tpl) and 2) cashondeliverywithfee (files validation.php or validation.tpl). Please, is it necessary to place TWO codes (two Google Conversion IDs) to each of these modules?

Or - is it possible to place ONE code to the final page (order-confirmation.php or order-confirmation.tpl)?

(In my validation.tpl is using $total)

Thanks in advance for your reply.

Link to comment
Share on other sites

  • 2 months later...
  Quote
Thanks, inveostore, very much!

So, I am using two modules for payments 1) bankwire (files payment.php or payment.tpl) and 2) cashondeliverywithfee (files validation.php or validation.tpl). Please, is it necessary to place TWO codes (two Google Conversion IDs) to each of these modules?

Or - is it possible to place ONE code to the final page (order-confirmation.php or order-confirmation.tpl)?

(In my validation.tpl is using $total)

Thanks in advance for your reply.



Devo, did you manage to make it work with CashOnDelivery?
If yes, can you post here exactly what you did? It would help me a lot lot!
I tried in the past to put in the order-confirmation files but somehow it was "breaking" the page and nothing was showed.
Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...
  • 5 months later...
  • 3 weeks later...
  • 3 weeks later...

I really do not understand why this should work...

 

It is placed in the redirect page which it seems executed while redirecting to the payment page, at the beginning not at the end. How can you be sure that it the person has paid if you count the purchase before it was made?

  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...
  • 1 month later...
  • 2 months later...
  • 2 weeks later...
  • 1 month later...
  On 7/7/2012 at 6:35 PM, kikbo said:

Fuck this redirect.tpl solution - it doesn't make sense. Paste the conversions code into order-confirmation.tpl (it works for me)

 

Did you put the google code as is?

 

 

<!-- Google Code for TEST Conversion Page -->

<script type="text/javascript">

...

 

Or between tags?

Link to comment
Share on other sites

×
×
  • Create New...