How to use Customer Privacy API for every customers and law c25

Hi,

I’m wondering if Shopify Customer Privacy API can be used for managing the consent for All customers and not only the one with an IP from European GDPR or CCPA? Evertyime I try to setTrackingConsent while in Canada it doesnt do anything. Looks like it works only for affected region of the world but what if we want to use this feature worldwide and track consent for everyone? Is that possible. (here is the doc https://shopify.dev/docs/api/consent-tracking#collect-and-register-consent)

There is a new law coming up in Québec Canada which is the law 25 and we need to be able to track and manage consent for everyone which doesnt seem possible at the moment.

Help would be really appreciated.

Thanks

Hi Lagunasolutions,

setTrackingConsent should be working for customers from any IP - I have connected with the team working on this and they have confirmed that it can be used everywhere. It’s possible that your implementation is not complete - I’d recommend doublechecking and testing your implementation.

Hope this helps!

Thanks for your Follow up Liam it’s really appreciated. My understanding from the documentation was that we could set consent using for example

window.Shopify.customerPrivacy.setTrackingConsent(
  {
    "analytics":    true,
    "marketing":    true,
    "preferences":  true,
    "sale_of_data": true,
  },
  () => console.log("Consent captured")
);

then afterward if we call

window.Shopify.customerPrivacy.currentVisitorConsent();

it should return True for all the four. But when I run those functions in the console the window.Shopify.customerPrivacy.currentVisitorConsent(); always return an empty array like

{marketing: '', analytics: '', preferences: '', sale_of_data: ''}

These should all be true after evoking the first function. There is something I do not get here.

Hope you can clarify this

Thanks

@Liam Did you have time to look into this? It would be really important to understand how to work with that API. Many other developpers seems to have misunderstood the way it works too.

@Liam Law 25 will be active this next friday. Would it be possible to have an answer for my last question. My understanding is that even the https://apps.shopify.com/customer-privacy-banner app that works with the Customer Privacy API only works for GDPR and CCPA otherwise the popup is not showing up. So can we know once and for all how to use the Customer Privacy API because it doesnt seem to work for all visitors.

Thanks

Look like so. We tried to contact Shopify multiple times about the issue and their answer stay the same “As of right now, we do not have an immediate solution for this. We will continue to work on finding a solution and reach out to you once we have an update.”

Please, we need this for our clients to comply to the Quebec Laws.

Thank you

Hello everyone,

I’ve been following the discussion and can confirm that Liam’s approach works well. I’d also like to mention that our app, Pandectes GDPR Compliance, fully supports Shopify’s Customer Privacy API and meets Google Consent Mode v2 requirements. We ensure easy compliance with privacy laws, making it straightforward for merchants to manage consent without complex coding.

If you’re looking to simplify compliance on both Shopify and Google fronts, feel free to reach out. We’re here to help.

Best,

Nikos T.
Co-founder, Pandectes