penske-media-corp / pmc-larva

PMC's design system.
pmc-larva-git-master-penske-media-corp.vercel.app
MIT License
19 stars 14 forks source link

PASE-1974: pmc-larva should support cookie consent category #840

Closed shawncook closed 5 months ago

shawncook commented 6 months ago

Per PASE-1974, we need to check for OneTrust cookie consent before setting cookie using pmc.cookie.set(). This passes in a category of 'functional' for the webfont loaded cookie setting.

Relates to https://github.com/penske-media-corp/pmc-plugins/pull/4102/

github-actions[bot] commented 6 months ago

Deploy preview for pmc-larva ready!

✅ Preview https://pmc-larva-koxlego72-penske-media-corp.vercel.app

Built with commit cce05a69b462884efa7ac1e975ae165d3a778318. This pull request is being automatically deployed with vercel-action

shawncook commented 6 months ago

@ethitter we do, in that pmc cookies aren't set when a user rejects all cookie categories. However, this lets us pass in a category when calling pmc.cookie.set() to conditionally set individual cookies based on whether the user has consented that particular category.

You're right though - there is a lot of existing code related to this behavior: https://github.com/penske-media-corp/pmc-plugins/blob/main/pmc-first-party-cookie/src/js/classes/FpcConsent.ts https://github.com/penske-media-corp/pmc-plugins/blob/main/pmc-cxense/assets/src/pmc-cxense-consent.js

shawncook commented 6 months ago

See also: https://github.com/penske-media-corp/pmc-plugins/pull/4102/

shawncook commented 5 months ago

We don't really need this, since fonts_loaded is covered under defaults in pmc-consent.js