Browser events

We provide some custom event triggers that you can listen to in JavaScript.

Initialization

This will be triggered when the SDK is initialized.

Event name edgetag-initialized

Event definiton
{
  destination: string, 
  userId: string, 
  isNewUser: boolean | undefined, 
  consent: Record<string, boolean | Record<string | boolean>> | null, 
  consentCategories: Record<string, boolean>,
  consentSetting: Record<string, string[]>
}
Example
window.addEventListener('edgetag-initialized', ({ detail }) => {
  console.log({
    userId: detail.userId,
    isNewUser: detail.isNewUser,
    consent: detail.consent
    consentSetting: detail.consentSetting
  })
})

This will be triggered when the consent function is called

Event name edgetag-consent

Last updated

Was this helpful?