Checkout Extensibility - Customer Order Count

Topic summary

A user is trying to migrate custom scripts to a custom pixel and needs to push customer order count to the data layer, but cannot find a way to access this data.

Another participant suggests accessing the order count through the init data available in Shopify’s Web Pixels API, specifically via the standard API init endpoint.

Status: The discussion appears to have a potential solution proposed but lacks confirmation of whether it successfully resolved the issue. The thread remains open with no verified resolution.

Summarized with AI on November 6. AI used: claude-sonnet-4-5-20250929.

Hello,

I’m unable to determine a way within a custom pixel to push customer order_count to the data layer. Has anyone who has had to migrate custom scripts to a custom pixel had any success?

https://shopify.dev/docs/api/liquid/objects/customer#customer-orders_count

Thank you

You should be able to get it via the init data:

https://shopify.dev/docs/api/web-pixels-api/standard-api/init