Cannot "accept" via Shopify's Privacy and Consent API.

js82
Shopify Partner
2 0 0

Hi, I'm using Shopify's consent and privacy api for a consent banner. Rejecting works fine but when I accept with 

 

window.Shopify.customerPrivacy.setTrackingConsent(true, console.log);

I get the following error:

 

 

{
  "code": "ineligible",
  "message": "cannot set origin cookies unless shop is blocking GDPR"
}

 

 

The API docs don't mention this, could someone please assist?

Replies 3 (3)

Liam
Shopify Staff
2731 299 769

Hi - this does seem like an unusual error, could there be store admin settings that is causing this? I'll also connect with our dev teams to see if they have any context on this error message.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

OKCK
Visitor
3 0 0

We can overcome that on Shopify native stores by setting this setting like that "Collected after consent".

OKCK_0-1706715762084.png

js82
Shopify Partner
2 0 0

I can't seem to find this an an option, if I got to Online Store > preferences > privacy it tells me it's now managed by /settings/privacy and when I check there, there's no options like you have above.

js82_0-1706862606652.png

 

I've just checked again though and it looks like it's been fixed on shopify's side or something because it appears to work now.

 

Thanks!