Discount Codes In Customer Sales Channel not being tracked by reports

Discount Codes In Customer Sales Channel not being tracked by reports

SimplyCoffee
Visitor
3 0 0

Hi,

 

All of our shopify traffic comes through our custom store/Sales Channel. We use the js-buy-sdk which interacts with the storefront api, this has been tested with js-buy-sdk as well as just using the storefront graphql api.

 

The problem is the discounts applied to orders in our store don't seems to be tracked. This means the sales by discount report is blank even though there have clearly been sales with discount codes in this date range.

Screenshot 2023-07-11 at 2.33.02 PM.png

 

It also means when I use the graphQL admin api and query for `codeDiscount` the `asyncUsageCount` values of the code is always 0. Even when the code has been used 100s if not 1000s of times.

 

Orders show up with discounts applied

Screenshot 2023-07-11 at 2.36.44 PM.png

 

A point in the right direction would be appreciated.

Reply 1 (1)

Liam
Shopify Staff
2862 313 816

Hi SimplyCoffee,

 

It sounds like your custom store and Sales Channel implementation isn't correctly registering the discount code usage in a way that Shopify's reporting system can track. When you create orders using the JS Buy SDK it doesn't interact with the same flows as a normal checkout process would, which could be why these discount usages aren't being tracked.

 

It could be worth opening an issue on this directly on the JS Buy SDK GitHub repo here, as the people there would have the most context on this library. 

 

Hope this helps,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog