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

Quick start

Learn how to integrate the Dastra cookie banner into a web page using the JavaScript SDK.

Prerequisite: get a public API key

The banner needs a public API key. Click the gear icon in the top bar (Organization settings), then Api keys & MCP in the left menu. See API key management.

The Api keys & MCP page with the list of keys
The "Api keys & MCP" page

Configure your banner

Configure your banner by following the guide below:

Banner setup

Insert the HTML integration code

Insert the HTML code available in the Installation section of the banner, JavaScript card, before the closing </body> tag of your website, on all pages. You can use Google Tag Manager to insert this code dynamically on each page.

For the code to work, the public API key must be configured beforehand.

Here is the banner integration code:

The div with the id dastra-cookie-consent is where the banner is rendered. The data-widgetid attribute identifies the banner: it is an integer. {your_public_key} is your public API key, available in Api keys & MCP.

Always copy the code from the application. Depending on the hosting region of your organization, the address of the script (cdn-bleu.dastra.eu instead of cdn.dastra.eu) and the address of the API (api-bleu.dastra.eu instead of api.dastra.eu) change.

Once the code is inserted before the </body> tag of your website, the banner appears.

Reopen the banner from a button

Withdrawing consent must be as easy as giving it. Add a button that reopens the banner to your website, for example in the footer. The same snippet is shown in the Installation section of the banner:

WordPress

If you use WordPress, the following page explains how to install the banner with the Dastra plugin.

Wordpress

Once the banner is integrated, move on to the testing phase.

Test the integration of a banner

Last updated

Was this helpful?