Skip to content

Audience rules

Audience rules decide where the widget shows up - and, just as importantly, where it doesn’t. They are suppression rules: when one matches, the widget simply doesn’t mount on that page view. Rules are evaluated in the shopper’s browser when the widget script runs, and re-checked on route changes in single-page storefronts.

Available rules

RuleWhat it does
hideOnPathsHide on URL paths matching any pattern in the list (up to 20). A plain string matches as a substring; wrap a pattern in /…/ to match it as a regex.
hideOnCartCheckoutHide on cart and checkout pages so the widget doesn’t compete with the payment form.
hideOnMobileHide on viewports narrower than 640px - for merchants who only want the widget on desktop and tablet.
loggedInOnlyShow only to logged-in shoppers (requires the platform bridge to report login state).
vipOnlyShow only to shoppers whose lifecycle stage is VIP.

Setting rules

The legacy /widget.js embed reads window.salespilotAiWidget before it runs. The generated per-store loader is a different path and does not read this browser object. Do not paste this override beside a generated loader and assume it changes launcher visibility. For the legacy path, place the configuration before the script:

js
window.salespilotAiWidget = {
  storeId: "YOUR_STORE_ID",
  widgetKey: "YOUR_WIDGET_KEY",
  audienceRules: {
    hideOnCartCheckout: true,
    hideOnMobile: false,
    // Substring match, or /regex/ when wrapped in slashes
    hideOnPaths: ["/pages/privacy", "/pages/terms", "/\\/legal\\//"],
  },
};
// Load https://app.zubbyai.com/widget.js after this configuration.
// Use one embed path per page; do not also load the per-store facade.

A quick example - hide the widget on checkout and legal pages:

  1. Open the page where your embed snippet lives (theme footer, custom code section - see Embed codes).
  2. Add audienceRules to the config object as above, with hideOnCartCheckout: true and your legal paths in hideOnPaths. Suppressing the widget at checkout keeps it from distracting shoppers mid-payment; legal pages are where the AI shouldn’t be a salesperson.
  3. Publish, then load a product page (widget shows) and the cart page (widget doesn’t) to confirm.

Platform-level toggles

  • WooCommerce - the plugin settings include “hide on checkout” (on by default) and “hide on cart” toggles; no code needed.
  • Shopify - the theme App Embed has an enable checkbox per theme, and you control placement via the theme editor.
  • Popup mode - the proactive popup has its own display scope (product pages only, cart only, both, or everywhere) plus a trigger (time on page, exit intent, cart idle) and a dismissal cooldown, configured in Dashboard → Widget Designer → Behavior.

Targeting the look, not the visibility

Separate from suppression, the Widget Designer can vary the widget’s appearance by context: per-page-type theme skins (e.g. a different preset on cart pages), scheduled seasonal themes, and an A/B theme variant split. Those change styling - they never hide the widget.

Audience rules vs. journey rules

Audience rules decide who sees the widget. Recovery journey rules (covered separately) decide who gets an email after they leave. Don’t conflate them - a shopper can match a rescue journey without ever having seen the widget.

Client-side by design

Rules run in the browser at mount time, so they apply instantly on every page view - including SPA navigations - without a server round-trip. They are a UX control, not a security boundary: the chat API itself is protected by your widget key and server-side rate limits regardless of where the widget renders.

Verify both sides of a rule

Test an allowed product path and an excluded checkout path, then navigate between them without a full reload on a single-page storefront. Test guest and signed-in users separately for login rules; a typed email is not a verified login. VIP rules require the host to provide the expected lifecycle state. Test at 639px and 640px for the mobile threshold. Confirm a malformed regex does not accidentally hide the experience you intended to show.

Missing something, or found an error on this page?

Contact support and include the URL of this page (/docs/widget/audience-rules).