How to add tw_sale_amount: 0 tw_order_quantity: 0 in a script



I have code some thing like below

// Insert Twitter Pixel ID and Standard Event data below

now from above script how can I add tw_sale_amount and tw_order_quantity?


Hi @MjainMitesh! Thank you for your question.

In the “single-event website tag” these parameters were readily available, as they appeared in the javascript code that you were adding to your page, but now, in the “universal website tag”, which is the one you’re using, this is not so straightforward. I looked at the javascript code that Twitter loads on your page and I figured out how you can still add these parameters:

twq('track', 'PageView', {
    "value": 0, // this is the old tw_sale_amount
    "num_items": 0 // this is the old tw_order_quantity

So instead of twq('track','PageView'); you would write like above. And they will be sent to Twitter.

But please note that in Twitter’s javascript code, these are called legacy parameters, and so even though they are sent, I don’t know if they are actually taken into consideration by Twitter on their end. But I would assume they are, since there are two other parameters that you can set that are not actually sent to Twitter servers, and these two are sent. But someone from the Twitter Staff should confirm this.

Hope this helps! :slight_smile:

Firing custom conversion events
closed #3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.