Customer Privacy API visitorConsentCollected event return name changes

Solved

Customer Privacy API visitorConsentCollected event return name changes

rossvor
Excursionist
17 0 11

On all our stores "visitorConsentCollected" event now instead of returning (as mentioned in the docs) :

{
firstPartyMarketingAllowed: true,
thirdPartyMarketingAllowed: true,
analyticsAllowed: true,
preferencesAllowed: true,
}

Returns:

{
    marketingAllowed : true,
    saleOfDataAllowed : true
    analyticsAllowed : true,
    preferencesAllowed : true,
}

 

I can't see mention of this change anywhere and came out of the blue and it obviously broke things.

 

What's going with Customer Privacy API lately? Last week it was broken for a day returning "400 (Bad Request)" now this.

 

Accepted Solution (1)
Liam
Community Manager
3108 341 879

This is an accepted solution.

Hi Rossvor,

 

We've reverted this change - can you check to see if the event is returning data as you'd expect now?

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

View solution in original post

Replies 6 (6)

Liam
Community Manager
3108 341 879

Hi Rossvor,

 

Thanks for flagging - I've connected with the internal dev team on this and will report back when I learn more about this behaviour.

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

rossvor
Excursionist
17 0 11

Thanks Liam,

 

If you get a response, can you also please query them on when exactly did it get renamed -- it would be useful for us to know when looking at our analytics (to know from which point the data became unreliable)

Liam
Community Manager
3108 341 879

This is an accepted solution.

Hi Rossvor,

 

We've reverted this change - can you check to see if the event is returning data as you'd expect now?

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

rossvor
Excursionist
17 0 11

Hello Liam,

 

No at this moment I still am seeing the new naming (I removed cache and tried a few browsers), that is:

 

 

document.addEventListener("visitorConsentCollected", (event) => console.log(event.detail));

// ... click on accept ...
{marketingAllowed: true, saleOfDataAllowed: true, analyticsAllowed: true, preferencesAllowed: true}

 

 

 

At this point I would not want it reverted tbh -- since I've already made the changes to accommodate the new naming.

 

What I would want is fixing the existing documentation, and a brief explainer on when this change was made so we would know what data to discount.

 

Also if you plan to make revert change -- would be nice to have some advance warning eg. add it to https://changelog.shopify.com/ or https://shopify.dev/changelog/

 

Thanks

Liam
Community Manager
3108 341 879

Can you DM me the store where you are testing this on and seeing `marketingAllowed : true,`? 

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

rossvor
Excursionist
17 0 11

I can now see the revert implemented -- it has both the marketingAllowed and (thirdPartyMarketingAllowed firstPartyMarketingAllowed) properties. Which is good since it means it did not break anything this time. Thanks

 

Can I rely on marketingAllowed remaining there in the future, or should I revert my own fix too (and look for thirdPartyMarketingAllowed, how I had it setup before)?