# Set up Consent on a site

The guided setup’s five steps, from adding a site to a dialog that looks like your site, then what you read.

Open **Consent** and press **Add a site**. The setup lists its steps down the left, **Where**, **Turn on**, **Install**, **Check** and **Customize**, with **Back** and **Continue** at its foot.

1. **Where** Choose **Any other website**: any site you host anywhere, by any means. Give it a **Name**, as your team calls it (visitors don’t see it), and its **Address**, with https. Add more addresses if it is served from several.
2. **Turn on** The dialog shows and records only on a site that holds a Consent seat, $10 a month for each site. Turning it off later gives the seat back, and the site’s records stay.

   > **Note:** Consent is not on sale yet. Until it is, no site can add it, and a site that already holds it keeps it. [Talk to us](https://www.stacklumen.com/contact) if you want it on a site now.
3. **Install** The tag is the same one line for every site. Put it in once, in the `<head>` of the layout every page shares, before your analytics and marketing tags. The key in it is public by design: it names the site to the dialog and opens nothing else.

   HTML:
   
   ```html
   <script src="https://www.stacklumen.com/consent/v1/consent.js" data-key="slc_pub_example_key_000000000000" async></script>
   ```
   
   React / Next.js:
   
   ```jsx
   export default function RootLayout({children}) {
     return (
       <html lang="en">
         <head>
           <script src="https://www.stacklumen.com/consent/v1/consent.js" data-key="slc_pub_example_key_000000000000" async />
         </head>
         <body>{children}</body>
       </html>
     );
   }
   ```
   
   Astro:
   
   ```astro
   <head>
     <!-- …your other head tags… -->
     <script is:inline src="https://www.stacklumen.com/consent/v1/consent.js" data-key="slc_pub_example_key_000000000000" async></script>
   </head>
   ```

   On a site builder, paste the HTML tag into its site-wide head code setting, then publish.
4. **Check** The step reads your page from our servers, as a visitor’s browser would, and looks for the tag with this site’s key. See [Check your installation](https://www.mintila.com/docs/consent/customise#check).
5. **Customize** The dialog’s corner, theme, accent, words and categories, beside the real dialog drawn from them. See [Customise](https://www.mintila.com/docs/consent/customise).

## Hold your own tags until they are allowed

A script that sets cookies or follows visitors shouldn’t run before they allow it. Give it `type="text/plain"` and `data-sl-consent` with its category (`analytics`, `functional` or `marketing`) and the browser leaves it alone until the visitor allows that category.

```html
<!-- Runs once the visitor allows Analytics -->
<script type="text/plain" data-sl-consent="analytics" src="https://analytics.example.com/a.js" async></script>

<!-- Inline code is held the same way; a module keeps its type in data-type -->
<script type="text/plain" data-sl-consent="marketing" data-type="module">
  startCampaignPixel();
</script>
```

- Name several categories (`data-sl-consent="analytics marketing"`) and every one must be allowed.
- Tags your page adds later, such as the next screen of a single-page app, are run as they appear, once the visitor has decided.
- Nothing held runs while the visitor hasn’t decided. Turning a category off doesn’t stop a script that already ran on the open page; from the next page it stays held.

## See the decisions

**Overview** shows the last 7, 30 or 90 days: decisions, visitors, the share of visitors who allowed each category (by each visitor’s latest decision), and where decisions were made. **Records** lists every decision, newest first: the time, the visitor (the first eight characters of their id), each category **Allowed** or **Off**, the policy version, the page and where it was made.

**Export CSV** downloads the decisions shown, up to 100,000. To answer an erasure request, find the visitor by their id and choose **Erase this visitor**: every decision they made on this site is deleted, and it can’t be undone.

> **Note:** A site built in StackIDE is set up from that site’s own Consent page in StackIDE.
