# Install the Privacy Badge

{% embed url="<https://www.loom.com/share/e88ad04851564e79b921be42c5eaf7d2>" %}

## Setup your privacy badge

1. log in to your Openli account
2. go to agreements and find the key for the agreement you want to link to the badge (Typically it would be your privacy policy).
3. If you don't have a agreement to choose from, follow the guide "Upload your terms". If you have already uploaded your privacy policy, you simply use the key for that agreement. Hold on to that key, We will need it in a moment.
4. Once you've selected an agreement, install this piece of code on your website just below your Openli cookie widget script:

```
<script>
  legal.widget({
    type: "privacy-badge-v1",
    agreementPublicKey: "YOUR_POLICY_KEY_HERE",
    targetElementSelector: "#privacy-badge",
  });
</script>
```

{% hint style="warning" %}
It is important it loads after the cookie widget script, as the script enables the badge functionality.
{% endhint %}

Make sure you replace the placeholder above with the public key of the policy you want to link to (the one we found earlier), from your Openli app.\
\
5\. Then place this div where you want the badge to show on your website. For example in the footer.

```
<div id="privacy-badge"></div>
```

Once this is done, the badge will show in the div when the page is loaded and you will be proudly displaying to the world that you care about your users privacy.&#x20;

![](/files/FfFAB64UipSbBNxg8LMy)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openli.com/docs/policy-and-agreement-management/install-the-privacy-badge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
