SEO, AdWords, affiliates, advertising, and promotions
Hi All,
I am trying to send User data for google ads enhanced conversion pixel on successful purchases. I have tried following code inside the customer events but upon validating the pixel the email is not getting passed.
Anyone has any solution for this ?
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
}
});
});
Hey @Charuhas ,
Did you add the Google Ads base code and enable the enhanced conversion tracking site-wide?
Thank You.
Hello,
Thank you for the message. Yes I have set the google ads base code and conversion as below. Let me know incase if anything flags out to you.
analytics.subscribe('page_viewed', (event) => {
// Load gtag.js script.
const script = document.createElement('script');
script.setAttribute('src','https://www.googletagmanager.com/gtag/js?id=AW-111111111');
script.setAttribute('async', '');
document.head.appendChild(script);
// Configure gtag.js script.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-11111111',{'allow_enhanced_conversions':true });
});
Thank you !
Charuhas
Hey @Charuhas ,
Could you please share the website URL so that I can further look into the implementation and provide you with detailed feedback?
Thank You.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025