Shop is not configured to block privacy regulation in online store settings - but it is

Hi,

I have written a cookie banner for a theme and have added the activation of consent following the Shopify documentation: https://shopify.dev/docs/themes/trust-security/cookie-banner In the Admin I have set the Customer privacy to Collected after consent.

But when I execute

window.Shopify.customerPrivacy.setTrackingConsent(
      {
        analytics: true,
        marketing: true,
        preferences: true,
        sale_of_data: true,
      },
      hideBanner
    );

I still geht the message: index.ts:215 Shop is not configured to block privacy regulation in online store settings.

Also reading the Customer Privacy API documentation did give me more insights.

What have I missed?

Obviously the response is the default for calling it when run with

shopify theme dev

Needs to be called from an installed theme…