Twitter Pixel

 

Conversion tracking enables you to measure your return on ad spend by tracking the actions people take after viewing or engaging with your ads on Twitter. Your conversion events will allow you to report on the performance of your campaigns but can also be used to help better optimize and target your ads.

 

Click Event

window.addEventListener('message', function(message) {
    if (message.data && message.data.event_type === 'spottButtonAction') {
		twq('event', 'xxxxxxx', {
		    value: message.data.event_data.asset?.customFields?.price,
		    currency: message.data.event_data.asset?.customFields?.currency,
		    contents: 
		    [
		       {
		         content_id: message.data.event_data.asset?.id, 
		         content_name: message.data.event_data.asset?.name, 
		         content_price: message.data.event_data.asset?.customFields?.price, 
		         num_items: '1'
		       }
		    ]
		  });
    }
});

Interaction Event

window.addEventListener('message', function(message) {
    if (message.data && message.data.event_type === 'spottInteractionEvent') {
		twq('event', 'xxxxxxx', {
		    value: message.data.event_data.asset?.customFields?.price,
		    currency: message.data.event_data.asset?.customFields?.currency,
		    contents: 
		    [
		       {
		         content_id: message.data.event_data.asset?.id, 
		         content_name: message.data.event_data.asset?.name, 
		         content_price: message.data.event_data.asset?.customFields?.price, 
		         num_items: '1'
		       }
		    ]
		  });
    }
});
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.