Shopify / Shopify/liquid

Shopify Customer Privacy API suddenly stopped working

Open
#1,482 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.