X ads pixel code for Purchase Event

ajsmith227
New Member
5 0 0

Having a hard getting purchase info back to X ads with pixel code. Site vists/lands working fine. See anything wrong in my code? 

 

 

 

 

 

 

!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", "myaccount");

analytics.subscribe("checkout_completed", (event) => {
  twq('event', 'purchasecode', {
    'value': event.data.checkout.subtotalPrice.amount,
    'currency': event.data.checkout.currencyCode,
    'email_address': event.data.checkout.email,
    'contents': contents,
    'conversion_id': order.number, 
    'phone_number': order.customer.phone
  });
});

 

 

 

 

 

 

Replies 0 (0)