Skip to content
Advertisement

How to add Google Ads conversion purchase event to my WooCommerce Thank you Page

I saw this Adding Google Ads Event Snippet To Conversion Page (thank you.php)

But I have a different situation. I am using ” Auto Complete Processing WooCommerce orders on Thank you Page” and “Redirect WooCommerce checkout page” all these are inside my functions.php file.

This is what my functions.php file looks like. I hid my site with ” ********* “

JavaScript

And I want to add the Event snippet inside the Thank You for google ads.

JavaScript

Because I am redirecting the thank you page to another page, the script will trigger? Or not?

And how and where do I add the Event snippet at the functions.php because I have a lot of code that control WooCommerce?

Advertisement

Answer

Since you’re redirecting to another page, you have to add the conversion code on that page. To do that, I set a transient to pass that value.

Your functions for thank_you can be combined.

This is tested and should work for you.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement