# Implement a cookie consent widget

DASTRA allows you to set up a cookie consent widget directly on your site in compliance with the recommendations of the CNIL (French Data Protection Authority) on cookies and other tracking devices.

## What is the Dastra cookie consent widget?

This widget is composed of several elements

<figure><img src="https://138894690-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-2584506019%2Fuploads%2F6C7JDBYbJydNYzQ8vGjp%2FCapture%20web_6-5-2022_93427_www.dastra.eu.jpeg?alt=media&#x26;token=bab7e0b0-450a-4ff4-8117-91e121d03c94" alt=""><figcaption><p>A "cookies" symbol appearing at the bottom left of the screen</p></figcaption></figure>

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2FnUr1AulyBU8awNDdw3oO%2FCapture%20d%E2%80%99e%CC%81cran%202023-02-21%20a%CC%80%2015.11.52.png?alt=media&#x26;token=1505c3c9-fa6c-4d59-a7aa-3d7f9dd939a1" alt=""><figcaption><p>A fold-out introduction window</p></figcaption></figure>

## Prerequisites&#x20;

To implement your cookie consent widget, you must first **identify** and **classify** the cookies **placed on your website by purpose**. DASTRA's Cookie Consent module allows you to do this in just a few clicks.

{% hint style="info" %}
To make the implementation of the cookie consent widget easier, Dastra has integrated all the necessary steps, from setting up the prerequisites to the lines of code, in the same module.
{% endhint %}

To scan the cookies placed on your website, go to the following page:

{% content-ref url="scannez-les-cookies-deposes-sur-votre-site-web" %}
[scannez-les-cookies-deposes-sur-votre-site-web](https://doc.dastra.eu/en/features/gerer-le-consentement-aux-cookies/configuration-du-widget/scannez-les-cookies-deposes-sur-votre-site-web)
{% endcontent-ref %}

To classify cookies by consent categories, go to the following page:

{% content-ref url="classifiez-les-cookies-par-categories-de-consentement" %}
[classifiez-les-cookies-par-categories-de-consentement](https://doc.dastra.eu/en/features/gerer-le-consentement-aux-cookies/configuration-du-widget/classifiez-les-cookies-par-categories-de-consentement)
{% endcontent-ref %}

## Set the appearance of your target cookie consent widget

To set up a cookie consent widget on your website, you must go to the "Appearance" interface of the DASTRA cookie consent module.

<figure><img src="https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LvBxs22wUMicv9uWp6C-1972196547%2Fuploads%2F9npKxLVjeTSbKXqzVBOw%2FCapture%20d%E2%80%99e%CC%81cran%202023-02-21%20a%CC%80%2015.18.41.png?alt=media&#x26;token=70be1500-41d2-4b65-816f-4b91050a8b3f" alt=""><figcaption><p>DASTRA Cookie Consent Module "Templating" Interface</p></figcaption></figure>

From this interface, you can **fully customize your widget** so that it displays the way you want it to on your website.

{% hint style="info" %}
You can also make other more general changes to the widget in the "Configuration", "Texts and translations" and "Triggers" sections.
{% endhint %}

Once the settings are complete, click on "Save and continue".

![](https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvBxs22wUMicv9uWp6C%2F-M4FZK905wvdW7EbqqxG%2F-M4Fbui3fB0DRRI44Zmq%2Fimage.png?alt=media\&token=b7c78e98-50e8-4a1c-b029-f3eb1db7c01c)

## Insert the widget code on your website

Once you have defined your target cookie consent widget, you can integrate it directly into your website using **lines of code automatically generated by DASTRA**.

To do this, go to the "Installation" interface of the DASTRA Cookie Consent module, and insert the automatically generated code before the end of the html tag on your website.

![Widget html code generation](https://2697025545-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvBxs22wUMicv9uWp6C%2F-M4Ii57EBU12HHaI3eSP%2F-M4IiczyXCqGma_ovqM6%2Fimage.png?alt=media\&token=864829d9-4b63-4a41-a1bf-c663a3e0f7e1)

{% hint style="info" %}
You can use the Google tag manager to dynamically insert this code on each page.
{% endhint %}

Don't hesitate to ask your webmaster to do this step. Once this is done, a widget will appear on your screen.

{% hint style="info" %}
For security reasons, only sites with an "https" SSL certificate can set up a widget.
{% endhint %}
