Quick start

Learn how to integrate the Dastra cookie widget into a web page using the javascript SDK.

Prerequisite: recovery of an API public key

to get a public key from the Dastra SDK, go to this page: https://app.dastra.eu/general-settings/api

Configure your widget

Configure your widget by following the guide below:

pageWidget configuration

Insert the html integration code

Insert the HTML code available in the "Code" section of the Dastra Cookie Consent Module before the end of the <BODY> tag on your website, on all pages. You can use the Google tag manager to dynamically insert this code on each page.

For the code to work properly, make sure the public key of your API is configured correctly beforehand.

Here is how the widget integration code looks:

<div id="dastra-cookie-consent" data-widgetid="{your_widget_id}"></div>
<script src="https://app.dastra.eu/sdk/dastra.js?key={your_public_key}" async>
</script>

The div with the id "dastra-cookie-consent" will be the rendering location of your consent widget. The "data-widgetid" attribute is used to identify the widget being invoked, it is often a number (int32). {your_public_key} is your API public key which can be retrieved here.

Once the code is inserted in the tag of your site, the widget will display on your site.

For optimal performance, the widget is automatically cached by the browser in the sessionStorage

Wordpress

If you use Wordpress, you will find in the link below more information on how the generated code can be inserted at the end of the html tag of your website.

pageWordpress

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

pageTest the integration of a widget

Last updated