Solved

Web Pixel init data for logged in customer showing undefined ordersCOunt

jc45
Visitor
2 1 0

I'm checking `init.data.customer` in a custom Web Pixel to get the `ordersCount` for the purpose of detecting repeat customers, but it is coming back as `undefined`. The customer is logged in, has orders, and all fields (`email`, `firstName`, etc.) are populated correctly, except for `ordersCount`.

 

Has `ordersCount` been deprecated or is there another reason why it may be `undefined`?

Accepted Solution (1)

jc45
Visitor
2 1 0

This is an accepted solution.

Following up to share that we were seeing `undefined` because all orders in the accounts we checked were test orders (we were testing on our staging shop), which are not counted. After creating manual orders, we see the value populated correctly for logged in customers.

View solution in original post

Reply 1 (1)

jc45
Visitor
2 1 0

This is an accepted solution.

Following up to share that we were seeing `undefined` because all orders in the accounts we checked were test orders (we were testing on our staging shop), which are not counted. After creating manual orders, we see the value populated correctly for logged in customers.