Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey guys, I've put this block of code inside custom pixel section on Shopify, but my client keeps telling me that the event is not triggering inside twitter:
!function(e,t,n,s,u,a){e.twq||(s=e.twq=function(){s.exe?s.exe.apply(s,arguments):s.queue.push(arguments); },s.version="1.1",s.queue=[],u=t.createElement(n),u.async=!0,u.src="https://static.ads-twitter.com/uwt.js", a=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(u,a))}(window,document,"script"); twq("config", "twitter_id"); analytics.subscribe("checkout_completed", event => { twq('event', 'event_id', { value: event.checkout.totalPrice.amount, currency: event.checkout.currencyCode, email_address: event.checkout.email || null, }); });
Am I doing something wrong? twitter_id and event_id are hidden for privacy/security reasons.
Should I be passing conversion_id as well for it work? If so, how do I get it from event object?
I don't believe the variables you've used in your code are going to work.
Use this instead:
analytics.subscribe("checkout_completed", (event) => {
twq('event', 'event_id', {
'value': event.data.checkout.subtotalPrice.amount,
'currency': event.data.checkout.currencyCode,
'email_address': event.data.checkout.email
});
});
Also, you can swap subtotalPrice for totalPrice in my example code.
Is there a trick to get this to "connect"? My connect button is not active with this code and my twitter id and event id
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