Consent and storage
How Benson respects your cookie banner, what strict mode does, and every key it can store on your storefront.
Jump to a section
Benson follows the consent signal your store already has. You choose the mode in Settings → Tracking; the default, auto, works for most stores.
Consent modes#
| Mode | What it does |
|---|---|
auto | Picks for you: Shopify's Customer Privacy API on Shopify, else an IAB TCF v2 CMP if one is present, else Google Consent Mode if your dataLayer has consent commands, else no consent signal. |
shopify | Reads Shopify's Customer Privacy API and follows the shopper's choice in your Shopify cookie banner. |
tcf | Reads an IAB TCF v2 CMP. Consent means purposes 1 and 8 are granted; outside GDPR scope it counts as not required. |
gcm | Reads the latest Google Consent Mode analytics_storage value from your dataLayer. |
manual | Waits for your code to call Benson.consent(true) or Benson.consent(false). |
none | No consent signal: Benson behaves as if consent isn't required. |
What changes with consent#
- Consent given, or not required: Benson keeps the session in local storage (shared across tabs), an anonymous visitor id to count returning visitors, and first-party cookies so the checkout can link an order to the session (on WooCommerce, the Benson plugin's
bn_wctoo). - Waiting, or declined: Benson keeps only a session-only id in session storage, with no visitor id and no cookie. It still measures the session, without anything that outlives the tab.
Benson never uses third-party cookies, never stores IP addresses, and puts no personal details in events.
Strict mode#
With strict consent on, a shopper who hasn't agreed (or has declined) is measured in memory only: Benson stores nothing and sends nothing except the install check. Turn it on if most of your traffic is from the UK or EU and your legal advice says analytics needs opt-in. Benson recommends it in your tracking settings when that's likely.
Test links#
Strict mode and sampling make one exception: a ?benson_test= link from your dashboard. Benson first confirms the token belongs to your store, and ignores the link otherwise. For that page view only, it runs the test in memory, stores nothing, and sends test events that are never kept. See Test Benson on your store.
Every storage key#
This is the complete list of what Benson can store on your storefront, from the same registry the script is tested against:
| Key | Where | What it's for | Needs consent? |
|---|---|---|---|
bn_s | Local storageSession storage until consent allows local storage | Current session id and timing (ends after 30 minutes idle or 24 hours). | No: session-scoped or functional |
bn_v | Local storage | Anonymous visitor id and first-seen time, to count returning visitors. | Yes, where consent is required |
bn_sid | Cookie | Session id shared with the checkout pixel so orders can be attributed. | Yes, where consent is required |
bn_aff | Cookie | The affiliate partner that referred this session, shared with the store's checkout outside Shopify. Set only on stores that lock a partner's code to that partner. | Yes, where consent is required |
bn_ca | Session storage | Which Benson cart attributes were already written to the current cart. | Yes, where consent is required |
bn_hb | Local storageSession storage until consent allows local storage | When the install heartbeat was last sent (at most every 30 minutes). | No: session-scoped or functional |
bn_ctx | Session storageMemory only until consent allows session storage | Landing page, referrer site, and campaign parameters of the current session. | No: session-scoped or functional |
bn_debug | Session storage | Debug logging switch, set only when a developer calls Benson.debug(). | No: session-scoped or functional |
bn_x | Local storageSession storage until consent allows local storage | Memory of the current session: which shopping extensions were already reported (so a page change doesn't report them twice), whether the visit arrived from a paid ad or affiliate link, which of the store's tools Benson loaded, and which side of a test or tool measurement the visit is in. | No: session-scoped or functional |
bn_nd | Session storage | Set when a visitor dismisses the store's note for AI shopping assistants, so it stays hidden for the rest of the visit. | No: session-scoped or functional |
bn_xt | Local storage | Which side of a tool measurement this visitor was in on earlier visits (the tool shown or held back), so later orders count toward the right side. Kept only with consent; deleted when consent is withdrawn or the measurement ends. | Yes, where consent is required |
bn_ext | Cookie | A signed note that a coupon extension was seen in this browser, so the store's checkout can apply its discount-code policy (30 days). | Yes, where consent is required |
bn_wc | Cookie | WooCommerce only (the Benson plugin): the session id, the coupon extensions detected in it, the store's tools Benson loaded and which side of a test or tool measurement the visit is in, read when an order is placed so the order is linked to its session. Renewed on each page; expires after 30 minutes. | Yes, where consent is required |
bn_w | Session storage | How often the discount widget opened itself in this session (and, without consent, when it was last closed). | No: session-scoped or functional |
bn_wf | Local storageSession storage until consent allows local storage | When the discount widget was last closed and how often it opened itself, so it doesn't pop up again too soon. | Yes, where consent is required |
bn_pending_code | Session storage | A discount code chosen in the widget, kept until a page with the store's promo box can fill it in. | No: session-scoped or functional |
bn_pr | Session storageMemory only until consent allows session storage | Which known coupon extensions are installed in this browser, checked once per visit on desktop Chrome and Edge, so later pages don't check again. | Yes, where consent is required |
Manual consent#
With manual, Benson waits until your code calls:
Benson.consent(true); // the shopper agreed
Benson.consent(false); // the shopper declined
Use it with any consent tool that exposes a callback. Until the call, Benson treats consent as pending.
On WooCommerce, the Benson plugin makes this call for you when your consent plugin supports the WP Consent API. See Consent on WooCommerce.
Stuck? Email [email protected].
