Archived topic
Google Ads Conversion Tracking Setup - Thank You Page
7 replies · Started by agramatikov on April 11, 2022
Hello Support Team,
I need to add Google Ads Conversion Tracking on Thank You page via GeneratePress Elements.
I've already added Global Site Tag Hook on wp_head -> entire site with priority 20 for example.
Now i need to add second Hook with the conversion tracking tag which will be again on wp_head, but i need this one to load after the Global Site Tag Hook, so i will add to this priority 25 for example.
The problem with the conversion tracking tag hook is that when i choose wp_head and switch to display rules i can choose pages -> order only, but i need to choose order-received (thank you page)
Is it possible to do that ?
Thank you.
Hi there,
so the thank you page ( order-received ) is an endpoint for the checkout.
So in your hook add this PHP to wrap around your script and make sure to check the Execute PHP option.
<?php
if ( is_wc_endpoint_url('order-received') ) { ?>
ADD YOUR SCRIPT HERE
<?php }
?>
Hello David,
Thank you. It's working.
Glad to hear that!
Hi,
Should this PHP-code to be added in "display on all pages"?
Hello there,
Try setting it to Page -> Checkout.
Hi,
Yes now ive setted conversion tag to checkout, does this seem right?
https://pasteboard.co/68PJRSYTx6ZJ.jpg
Also i have setted Global tag:
https://pasteboard.co/9hwCI6EPa8Ut.jpg
But i cant see event tag still in source code, should i?
Hi there,
that looks correct.
Try setting the Display Rule to Entire Site if its not working correctly.