Shopify Customer Privacy API suddenly stopped working
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
Hi, I have been using the Shopify Customer Privacy API for almost a year with no problems.
Today my consent banner suddenly started bugging out. Please pass this along to your dev team.
Here's the bug:
TypeError: Cannot read properties of undefined (reading 'loadFeatures')
TypeError: undefined is not an object (evaluating 'window.Shopify.loadFeatures')
This seems like an internal bug that Shopify needs to fix. Around the same time, I started getting
liquid error: Internal
showing up at the top of my page. When I removed my Shopify Customer Privacy Api code, the liquid error also went away. That's weird since the shopify customer privacy code is in javascript, not liquid.
Here's my code:
window.Shopify.loadFeatures(
[
{
name: 'consent-tracking-api',
version: '0.1',
},
],
(error) => {
if (error) {
console.error(error); // if you want to raise
}
if (window.Shopify.customerPrivacy.shouldShowGDPRBanner()) {
setShow(true);
}
},
)
function onAccept() {
window.Shopify.customerPrivacy.setTrackingConsent(true, () => setShow(false));
}
function onDecline() {
window.Shopify.customerPrivacy.setTrackingConsent(false, () => setShow(false));
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository file, test, or entry point to inspect; it only reports Shopify Customer Privacy API errors and a Liquid internal error. Start by checking whether the reported behavior belongs in this repository and whether it can be reproduced, then identify a project-owned failure and a testable expected result before attempting a change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 10/100