Hello,
This is related to the Discount type in Customer Events. Specifically related to the checkout_completed Web Pixel event as documented at https://shopify.dev/docs/api/web-pixels-api/standard-events/checkout_completed
The document refers to the discount type being ‘DISCOUNT_CODE’ and the sample code also shows:
if (discount.type === ‘DISCOUNT_CODE’) …
However, when I checked the event, I am getting the discount type as “code” instead of “DISCOUNT_CODE”. See extract of the event data I am getting on checkout_completed. Some parts obfuscated below. Entire data not shown. Discount type highlighted in red below.
{> “id”:““,> “name”:“checkout_completed”,> “data”:{> “checkout”:{> “attributes”:[> > ],> “billingAddress”:{> “address1”:”“,> “city”:”“,> “country”:“US”,> “countryCode”:“US”,> “firstName”:“Sharat”,> “lastName”:”“,> “province”:“CA”,> “provinceCode”:“CA”,> “zip”:”“> },> “token”:”",> “currencyCode”:“USD”,> “discountApplications”:[> {> “allocationMethod”:“ACROSS”,> “targetSelection”:“ALL”,> “targetType”:“LINE_ITEM”,> “title”:"S*_TEST”,> “type”:“code”,> “value”:{> “percentage”:100> }> }> ],> > …
Please clarify why this is not matching with the Shopify documentation.
Thank you,
With Regards