For the complete documentation index, see llms.txt. This page is also available as Markdown.

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, 
  geoCountry: string,
  geoRegion: string,
  session: Record<string, string[]>,
  userIP: string,
  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,
    ip: detail.userIP,
    consentSetting: detail.consentSetting
  })
})

This will be triggered when the consent function is called

Event name edgetag-consent

Last updated

Was this helpful?