We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With the change to checkout extensions, the only way to add pixels is through the web-pixels-api (Customer Events) but we have found some limitations.
We are currently trying to add javascript code that requires the use of the products barcode property. The problem is the web-pixels-api does not expose the property "barcode" only SKU. See https://shopify.dev/docs/api/web-pixels-api/standard-events/checkout_completed
analytics.subscribe("checkout_completed", (event) => { let date = new Date(); date.setTime(date.getTime() + (86400 * 1000)); const datestring = date.toISOString().slice(0, 19).replace('T', ' '); let barcodes = []; const lineItems = event.data?.checkout?.lineItems; const lilen = lineItems.length; for(let i = 0; i < lilen; i++){ barcodes.push({"gtin": lineItems[i].variant.barcode} } window.gapi.load('surveyoptin', function() { window.gapi.surveyoptin.render( { "merchant_id": 123456789, "order_id": event.data?.checkout?.order?.id, "email": event.data?.checkout?.email, "delivery_country": event.data?.checkout?.shippingAddress?.countryCode, "estimated_delivery_date": datestring.split(' ')[0], "products": barcodes }); });
lineItems[i].variant.barcode should exist.
The text was updated successfully, but these errors were encountered:
Just wondering if this is on anyone's radar. We are still held back from using the new features due to the issue above.
Sorry, something went wrong.
No branches or pull requests
Please list the package(s) involved in the issue, and include the version you are using
With the change to checkout extensions, the only way to add pixels is through the web-pixels-api (Customer Events) but we have found some limitations.
Describe the bug
We are currently trying to add javascript code that requires the use of the products barcode property. The problem is the web-pixels-api does not expose the property "barcode" only SKU. See https://shopify.dev/docs/api/web-pixels-api/standard-events/checkout_completed
Steps to reproduce the behavior:
Expected behavior
lineItems[i].variant.barcode should exist.
The text was updated successfully, but these errors were encountered: