Google Ads Enhanced Conversion Data via Customer Events Pixel

Hi All,

I was wondering if anyone has created a Customer Event for Google Ads with the Enhanced conversion data enabled?

https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels

https://community.shopify.com/post/1694108

I believe it needs the following:

analytics.subscribe("checkout_completed", async event => {
gtag('event', 'conversion', {
'send_to': 'AW-###/####',
'value': '{{ checkout.subtotal_price | divided_by: 100.0 }}',
'currency': '{{ currency }}',
'transaction_id': '{{ order_number }}',
});
var enhanced_conversion_data = {
"first_name":'{{ billing_address.first_name }}',
"last_name":'{{ billing_address.last_name }}',
"email":'{{ checkout.email }}',
"phone_number":'{{ billing_address.phone }}',
}
});

Thoughts?

Hi Anttopham,

I have tried following code but upon checking then email is not getting passed. Did your code worked ?

analytics.subscribe("checkout_completed", (event) => {
gtag('event', 'conversion', {
      'send_to': 'xxxxxxxxxxxxxxxxxx',
      'value': event.data.checkout.totalPrice.amount,
      'currency':  event.data.checkout.currencyCode,
      'transaction_id': event.data.checkout.order.id
  });

  gtag('set', 'user_data', {
  "email": event.data.checkout.email,
"phone_number": event.data.checkout.phone,
    "address": {
"first_name": event.data.checkout.shippingAddress.firstName,
"last_name": event.data.checkout.shippingAddress.lastName,
"city":event.data.checkout.shippingAddress.city,
"postal_code": event.data.checkout.shippingAddress.zip,
"country": event.data.checkout.shippingAddress.country
}
});
});

Do you have any idea how to make this work ?