Skip to content

applyConsent

function applyConsent(state, options): void

Defined in: apply.ts:60

Apply a consent state to the document by:

  1. Activating any <script type="text/plain" data-tb-category="X"> whose category was granted
  2. Calling gtag('consent', 'update', ...) if gtag is on the global scope
  3. Dispatching a tickbox:consent-changed CustomEvent for any custom integrations

No-op on the server.

Parameters

ParameterType
stateConsentState
optionsApplyOptions

Returns

void