# smootify-consent

> Cookie banner and preferences panel built over Shopify's Customer Privacy API: shown while Shopify asks for consent and the visitor has not answered, the preferences while open. With button[data-is="preferences-button"] inside (one component, e.g. in the Footer, the banner in a [popover] or [consent-panel]) it stays for the button wherever the consent applies, the banner closed until asked; elsewhere it is hidden whole (2.0).

Status: Ready (Smootify 2.0)  
URL: https://www.smootify.io/docs/astro/reference/elements/smootify-consent  
Updated: 2026-10-21

## Where it can go

- **Anywhere** on the page.
- **Out of place,** it stays in the page and does nothing.

## What it requires

Nothing beyond Smootify: it works on every plan.

## Fields in the form

Each field’s `name` attribute tells Smootify what the field holds.

| Name | Field | What it does |
|---|---|---|
| `analytics`, `marketing`, `preferences`, `sale_of_data` (or `saleOfData`) | `input type="checkbox"` (`name` exactly) | Checked: that kind of tracking is allowed, saved by `[data-action="save"]`; the boxes follow the stored consent. |

## Attributes on the element

- **Smootify writes** `is-loaded`, `is-required`, `is-open`, `is-sale-of-data-region`, `is-applicable` on it: do not set them yourself.

## Attributes inside it

| Group | Attribute name | Values |
|---|---|---|
| [Cookie consent](https://www.smootify.io/docs/astro/reference/attributes/consent) | `data-action` | 11 |
| [Cookie banner (condition)](https://www.smootify.io/docs/astro/reference/conditions/consent) | `consent-condition` | 1 |

## Loading

Its code loads only on pages that have `smootify-consent`.
