Cookies management
This page provides an overview and usage guidelines for the privacy API related to cookies consent management - more specifically cookies, local and session storages consent and access.
This page covers:
_fwn.cookies
Cookies consent API callbackscookies_opt_in
configuration to prevent any storage access until consent is givencookies_root
configuration to prevent cookies being created at root domain
Firework widgets distinguish several cookie (local/session storage) categories.
essential
functional
performance
targeting
Configuration
There are two implicit behaviors in which widgets can be configured - opt-in
and opt-out
(default).
Opt-out
Widget and Player uses cookies, local and session storages directly. This is a default behavior.
Opt-in
Widget and Player awaits for a consent to be given for each category to access user’s browser storages. Until then all storage data are kept in memory. Reloading page will cause storage data loss and user will refresh its identifiers.
To integrate widgets with opt-in strategy, integration must include cookies_opt_in="true"
param on a script tag via data attribute data-fwparam_cookies_opt_in
.
Example:
Root domain
Some cookies might be set on root domain to be accessible across subdomains. For example widget placed on www.example.com
will attempt to set the same cookie to .example.com
as well as www.example.com
The goal here is to be able to attribute purchase on shop.example.com
to a video which was consumed on live.example.com
. We understand such behavior might be undesired and can be disabled by add cookies_root="false"
param to a global page configuration.
Example of a script tag with global configuration:
Managing consent
To grant or revoke particular consent at any time, _fwn
web SDK provides several options:
_fwn.cookies.enableCookies
to grant consent for each given category_fwn.cookies.disableCookies
to revoke consent for each given category_fwn.cookies.setConsent
revokes all consents, then grants consent to each given category
All functions above accept comma separated list of consent categories or empty string to indicate all categories.
Example:
Last updated