In the storefront our app relies on customer privacy API to do some checks. So we load the consent-tracking-api using window.Shopify.loadFeatures (Customer Privacy API) and in the callback we call the API functions to do the check. But the callback is not invoked sometimes. What would be the reason that loading the consent-tracking-api API does not invoke the callback function (at least with an error)?
window.Shopify?.loadFeatures?.([{name: 'consent-tracking-api', version: '0.1'}],
error => {
if (error) {
//Handle callback failure
}
//Do our privacy checks here.
});