Skip to main content

SDK Methods

Under window.illow you will find the following API:

setLanguage

This method changes the language used in the banner. It fires the illow:language_changed event.

setLanguage(language)

ParameterRequiredValuesDescription
languageYes'ar', 'bg', 'cs', 'da', 'de', 'el', 'en', 'en-gb', 'es', 'fi', 'fr', 'he', 'hr', 'hu', 'it', 'nb', 'nl', 'pl', 'pt', 'pt-pt', 'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'th', 'tr', 'ua', 'ca', 'fr-ca'ISO Code for the language to be used in the banner.
window.illow.setLanguage('de');

getConsent

This method obtains the consent state.

getConsent()

Returns object with:

PropertyRequiredValuesDescription
consent-idYesstringID for the consent.
marketingYesbooleanWhether consent for marketing tools is enabled or not.
preferencesYesbooleanWhether consent for preferences tools is enabled or not.
statisticsYesbooleanWhether consent for statistics tools is enabled or not.
optedInYesbooleanOnly present in US opt-out model. True, if "Don't sell my data" is off. False otherwise.
userIdNostringThe user ID for the consent if the user was identified.
window.illow.getConsent();

showWidget

This method opens the consent widget. If using the US opt-out model + Notice mode, the "Don't sell my data" notice will be shown. If not, the banner will be rendered. It fires the illow:widget_opened event.

showWidget()

window.illow.showWidget();

identify

This method identifies the consent with the User ID sent. It makes the consent cross-device. Check the Authenticated Visitor Use Case. It fires the illow:identity_added event.

identify(userId)

ParameterRequiredValuesDescription
userIdYesstringThe ID for the user you are identifying. It is managed by you.
window.illow.identify('123');

removeIdentity

This method removes the identity being used. It makes illow use an anonymous consent again. Check the Authenticated Visitor Use Case. It fires the illow:identity_removed event.

removeIdentity()

window.illow.removeIdentity();

refreshWidget

This method refreshes the UI of the widget. It fires the illow:widget_refreshed event.

refreshWidget()

window.illow.refreshWidget();