consent.onUpdate
Method to subscribe to TrustCommander consent updates OnSite via JavaScript.
Last updated
Was this helpful?
Method to subscribe to TrustCommander consent updates OnSite via JavaScript.
Last updated
Was this helpful?
The consent.onUpdate
method allow to subscribe a callback function for consent updates. The callback function will be called with the updated Consent Object. It is called whenever the consent is changed via a TrustCommander banner interaction or the consent.update
method of the OnSite API.
The consentObject
argument will also be enriched with an additional property updateEvent
to signal how the update happened. It can have following values:
Value
Description
set
The consent was set.
changed
Consent was already established and then changed.
revoked
Consent was revoked by the user. Used for cleanup tasks like deleting cookie identifiers.
In this example the Analytics category was configured with the consent category id 2 in TrustCommander.
In this example the Analytics category was configured with the consent category id 2 in TrustCommander.