2.0 Beta

Smootify 2.0 is in public beta. Your 1.x store keeps working. Move when you want.

What changed

smootify:consent_changed

the visitor's consent once it is known on the page, then at every change

v2.0 beta
Open .md
On this page
  1. Listen
  2. Payload
  3. ConsentSnapshot

the visitor’s consent once it is known on the page, then at every change New in 2.0.

Listen

window.Smootify = window.Smootify || [];
window.Smootify.push((api) => {
  api.on("consent_changed", (payload) => {
    // …
  });
});

Payload

ConsentSnapshot

ConsentSnapshot

/** The visitor's consent, from Shopify's Customer Privacy API. */
export interface ConsentSnapshot {
  /** Shopify's script answered */
  loaded: boolean;
  /** the visitor's region asks for consent and it is not given yet (the banner shows) */
  required: boolean;
  /** US privacy laws: the "do not sell my data" choice applies */
  saleOfDataRegion: boolean;
  region: string;
  answers: Record<ConsentKey, ConsentAnswer>;
  allowed: Record<ConsentKey, boolean>;
  /** the visitor answered at least one category */
  interacted: boolean;
}

    ↑ ↓ to moveEnter to openEsc to close