How to extract Order number and subTotalAmount from Thank you page and insert into a custom tracking pixel

How do I insert the tracking pixel below in the Thank you page and replace ORDER_ID with the thankYouPage Order number and replace SALE_AMT with TotalOrder without shipping and taxes amount. Thanks in advance.

Hi,

You can view the order on the thank you page, using $w(‘#myThankYouPage’).getOrder(),
check out the documentation here .

Good luck,
Or

Hi

I am doing this but there’s no data inserted into my pixel. There’s no data in the 2 fields “adv_sub” and “amount” of my Pixel. Am I doing something wrong? sorry not I am new coder.

var ORDER_ID;
var SALE_AMT;

$w(‘#thankYouPage1’).getOrder()
.then( (order) => {
ORDER_ID = order.number;
SALE_AMT = order.totals.subtotal;
// see example order object below
} )
.catch( (error) => {
console.log(error);
} );
External Media

Hey, did you find a solution to this? I’ve got a very similar problem