Google advertising conversion code

Merchant
Lähettäjä United Kingdom
Jäsen alkaen maalisk. 2021

Hi
I believe that somewhere there is a php page that activates after a successfull payment has gone through ?
I need to add this google code to that php page..

Not sure which php page to change and where to place the above code.
This notifies google ads that someone actually came and purchased something.
Anyone got any ideas to help me out ?
Thanks

<!-- Google tag (gtag.js) event -->
<script>
gtag('event', 'ads_conversion_Checkout_1', {
// <event_parameters>
});
</script>
tim
Founder
Lähettäjä Sweden
Jäsen alkaen toukok. 2013
tim

This is what a javascript event could look like. You can put this in your app.js file.
But this example is for analytics. And you would have to change the gtag to whatever Google Ads wants you to send.
If the user has not consented to your cookie policy you cannot send the event.

// Order Success
  if (window.location.pathname.match(/\/order_success$/)) {
    let order = $('#box-order-success'),
      items = [];

    $(order).find('.item').each(function(){
      items.push({
        'id': $(this).data('id'),
        'name': $(this).data('name'),
        'price': $(this).data('price'),
        'quantity': $(this).data('quantity')
      });
    });

    gtag('event', 'purchase', {
      'transaction_id': $(order).data('id'),
      'value': $(order).data('payment-due'),
      'currency': $(order).data('currency-code'),
      'tax': $(order).data('total-tax'),
      'items': items
    });
  }
Merchant
Lähettäjä United Kingdom
Jäsen alkaen maalisk. 2021

Thanks

Sinä
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.