Add this to your child theme function.php at the end, and insert the proper tag. ``
<?php
function ds_checkout_analytics( $order_id ) {
$order = new WC_Order( $order_id );
$currency = $order->get_order_currency();
$total = $order->get_total();
$date = $order->order_date;
?>
<!-- Paste Tracking Code Under Here -->
<!-- End Tracking Code -->
<?php
}
add_action( 'woocommerce_thankyou', 'ds_checkout_analytics' );
``
Answer from jrubix on Stack OverflowDoes anyone know where to connect and paste the Google Ads Event Snippet -code?
Now that the Shopify Checkout settings Additional Scripts -portion of Shopify has disappeared and depricated, I want to install the Event Snippet code using the Google Tag method, and not with Tag Manager or by installing the Google App.
All the instructions and blogs about the subject try to use Tag Manager, instead of Google Tag. Or they change and alter the Event Snippet -script into Enchanted Tracking code. I only want to use the original code that you can copy directly from Google Ads.
Does anyone know a simple way to just to add the original Event Snippet checkout page code from Google Ads with google tag into Shopify in 2024. Custom Pixel? Theme.liquid ?
I'm talking about this Event Snippet code:
<!-- Event snippet for Purchase - STORE NAME conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': 'AW-XXXXXXXXX/xxxxxxxxxxxxxxxxxxx',
'value': {{ checkout.total_price | money_without_currency }},
'currency': 'USD',
'transaction_id': '{{ order.order_number }}'
});
</script>
How to Add Google AdWords "Event Snippet" to Pro's Email Form - Support - Themeco Forum
Setting up event snippet for google ads conversion tracking
Installing an 'Event Snippet' with Tag Manager
Deprecated Additional Scripts: Where to move Google Ads Event Snippet in Shopify?
What's the difference between Google Analytics goals and Google Ads conversions?
How do I know if my Google Ads conversion tracking is working?
Why am I not seeing conversions in my Google Ads account?
Videos
Hello,
I am trying to track 2 very simple conversions on one webpage with Ad Words. I setup both conversions in Ad Words, added the right ID and label to the GTM tag, and setup a basic "just links" trigger for each tag. However there are no conversions showing on the AdWords side. I reached out to Google and they said the global GTM is setup across the website but we need to add an 'event snippet' to the particular page where the conversions take place.
How do I do this with GTM? Novice GTM user here...