Opening the Drawer (Storage Preferences)

  • Updated

There may be cases where you wish to open the storage preferences drawer where users can change their consent preferences without using the Osano cookie widget (the cookie icon). You can achieve this using the following code: 

To trigger the Storage/Cookie preferences drawer, you can utilize the following Javascript: 

  • Osano.cm.showDrawer('osano-cm-dom-info-dialog-open')
    • This is the preferred method.
    • In some cases, window.Osano.cm.showDrawer should be used
  • DEPRECATED: Osano.cm.emit("osano-cm-dom-info-dialog-open")
    • This method has been deprecated. Please utilize Osano.cm.showDrawer.

Examples: Osano.cm.showDrawer

<a href="#" onclick="Osano.cm.showDrawer('osano-cm-dom-info-dialog-open')">Cookie Preferences</a>
<a onClick={Osano.cm.showDrawer('osano-cm-dom-info-dialog-open')}>Cookie Preferences </a>

Example: window.Osano.cm.showDrawer

@click="window.Osano.cm.showDrawer('osano-cm-dom-info-dialog-open')"