> For the complete documentation index, see [llms.txt](https://doc.dastra.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.dastra.eu/de/features/cookies/integration/quickstart.md).

# Schnellstart

Erfahren Sie, wie Sie das Dastra-Cookie-Banner mithilfe des JavaScript-SDK in eine Webseite integrieren.

## Voraussetzung: einen öffentlichen API-Schlüssel abrufen

Das Banner benötigt einen öffentlichen API-Schlüssel. Klicken Sie in der oberen Leiste auf das Zahnradsymbol (**Organisationseinstellungen**) und dann im linken Menü auf **API-Schlüssel & MCP**. Siehe [API-Schlüssel verwalten](https://doc.dastra.eu/de/features/settings/api-keys.md).

<figure><img src="https://1094947073-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgG4SiA7dB1sjSI91cItk%2Fuploads%2Fgit-blob-48cf9361a1c99d0e8d5b2a5fd00bef0405f61be8%2Fcookies-quickstart-1.png?alt=media" alt="Die Seite API-Schlüssel &#x26; MCP mit der Liste der Schlüssel"><figcaption><p>Die Seite „API-Schlüssel &#x26; MCP“</p></figcaption></figure>

## Ihr Banner konfigurieren

Konfigurieren Sie Ihr Banner anhand der folgenden Anleitung:

{% content-ref url="/pages/dC0IAXQfVHePjDXk00VE" %}
[Einrichtung des Banners](https://doc.dastra.eu/de/features/cookies/banner.md)
{% endcontent-ref %}

## Den HTML-Integrationscode einfügen

Fügen Sie den HTML-Code aus dem Abschnitt **Installation** des Banners, Karte **Javascript**, auf allen Seiten Ihrer Website **vor dem schließenden `</body>`-Tag** ein. Sie können Google Tag Manager verwenden, um diesen Code dynamisch auf jeder Seite einzufügen.

{% hint style="info" %}
Damit der Code funktioniert, muss der öffentliche API-Schlüssel zuvor konfiguriert worden sein.
{% endhint %}

Hier ist der Integrationscode des Banners:

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

Das `div` mit der ID `dastra-cookie-consent` ist die Stelle, an der das Banner angezeigt wird. Das Attribut `data-widgetid` identifiziert das Banner: Es ist eine ganze Zahl. `{your_public_key}` ist Ihr öffentlicher API-Schlüssel, den Sie unter **API-Schlüssel & MCP** finden.

{% hint style="info" %}
Kopieren Sie den Code immer aus der Anwendung. Je nach Hosting-Region Ihrer Organisation ändern sich die Adresse des Skripts (`cdn-bleu.dastra.eu` statt `cdn.dastra.eu`) und die Adresse der API (`api-bleu.dastra.eu` statt `api.dastra.eu`).
{% endhint %}

Sobald der Code vor dem `</body>`-Tag Ihrer Website eingefügt ist, erscheint das Banner.

{% hint style="warning" %}
Aus Leistungsgründen speichert der Browser das Banner im `sessionStorage` zwischen.
{% endhint %}

## Das Banner über eine Schaltfläche erneut öffnen

Das Widerrufen einer Einwilligung muss so einfach sein wie das Erteilen. Fügen Sie Ihrer Website eine Schaltfläche hinzu, die das Banner erneut öffnet, zum Beispiel in der Fußzeile. Dasselbe Snippet wird im Abschnitt **Installation** des Banners angezeigt:

```html
<button type="button" onclick="dastra.openCookieConsent()">Check your cookie consent</button>
```

## WordPress

Wenn Sie WordPress verwenden, erklärt die folgende Seite, wie Sie das Banner mit dem Dastra-Plugin installieren.

{% content-ref url="/pages/X5iE4lu9lXWrLHBBOy2S" %}
[Wordpress](https://doc.dastra.eu/de/features/cookies/integration/quickstart/wordpress.md)
{% endcontent-ref %}

Sobald das Banner integriert ist, gehen Sie zur Testphase über.

{% content-ref url="/pages/in1xQGT2NCXG5890pODd" %}
[Banner-Integration testen](https://doc.dastra.eu/de/features/cookies/integration/test.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.dastra.eu/de/features/cookies/integration/quickstart.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
