Pixel API param 'ordersCount' always shows 0

Topic summary

Pixel init.data.customer.ordersCount in Shopify Web Pixels returns 0 consistently, even for customers with many orders and across different events.

Troubleshooting indicates it’s not a loading/timing issue; other init fields populate correctly. Multiple users reproduced the problem on different stores.

Latest update: The issue occurs when the Bogus payment gateway is used on test stores. Shopify support advised using the Cash on delivery (COD) gateway for testing. On production stores (non-Bogus), ordersCount behaves as expected.

Implications:

  • Tests using the Bogus gateway can falsely show ordersCount = 0.
  • Analytics or logic relying on ordersCount may be misleading in such test environments.

Outcome/Status: Practical workaround identified (use COD on test stores or test on production). No official fix for the Bogus gateway scenario noted. Discussion appears largely resolved with this explanation.

Notes: Screenshots were provided but are not essential to understand the issue or resolution.

Summarized with AI on December 23. AI used: gpt-5.

Hey Community,

Perhaps someone has encountered that when using init.data.customer.OrdersCount parameter always returns 0?

I’ve tried several variations on several shops and it always returns zero, even though the account has a lot of orders.

Here’s what I used for the tests:

And the result is always 0, both on purchase and on other events:

Any tips would be appreciated

2 Likes

The init.data.customer.ordersCount returning 0 might be due to timing or data availability issues. Ensure that the init object is fully loaded and the customer data is accessible before trying to retrieve the order count

Thanks for pointing it out for this and your reply!

I’ve checked, that’s definitely not the problem, all other init data works without problems.

Perhaps there are more ideas?

1 Like

I’m facing the same issue…

Hi @Epats ,
it seems that the “ordersCount” doesn’t work when the Bogus payment gateway is used.

The suggestion from the Shopify support is to use Cash on delivery payment gateway on test stores.

The “ordersCount” is working as expected on production stores.