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.
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