Skip to main content
The Buy with AI widget gives shoppers an on-page way to hand a purchase to an AI agent they already use. The agent asks what they need, compares the live offerings in your ZeroClick storefront, recommends an option, and completes the purchase only after the shopper approves it. When a shopper picks an agent, the widget fetches a walkthrough prompt from your storefront and opens that agent when a direct handoff is available. It also copies the prompt, so the shopper can paste it if the app does not open. If the prompt cannot load, the widget sends the shopper to your storefront instead. The widget does not contain your catalog, prices, or purchasing instructions. Those stay on your storefront, so the handoff always starts with current information.

Open the visual customizer

Open your store, then go to Discovery listings → Buy with AI → Customize to preview the widget and copy a generated snippet.

Add the widget

Copy the generated snippet from the dashboard when possible. It fills in the storefront URL, store name, and agent-readable discovery attributes for you. The base snippet has one marker element and one hosted script:
Place the <div> where the widget should render. Replace every Acme value with your own store’s values if you write the snippet by hand. The hosted script can appear anywhere after the marker and can initialize widgets added later by a single-page app.
If you place more than one widget on a page, add a marker for each location but load buy-with-ai.js only once.
The script reads each marker’s attributes when it initializes that widget. To change an attribute after the widget has rendered, replace the marker element so the script initializes it again.
If your site sets a strict Content-Security-Policy, allow script-src for cdn.zeroclick.io and connect-src for your storefront origin. The widget fetches the walkthrough prompt and sends its analytics beacons to that origin.

Required attributes

Keep these attributes in every snippet. The last three make the handoff legible to agents that read the page’s raw HTML without running JavaScript.

Customize the layout and actions

Add any optional attribute below to the marker element. Omitted attributes use the defaults shown here.

Layouts

Customize the style

Style attributes accept CSS values. Colors accept any valid CSS color; the dashboard emits hexadecimal colors. The widget renders in a shadow root, so these attributes are the most predictable way to align it with your site. For example:

Customize the copy

Every copy override uses data-string-{key}. You can change one string without supplying the others, or override the full set to translate the widget. Three placeholders insert runtime values:
  • {SELLER} inserts data-seller-name.
  • {BRAND} inserts the selected agent brand, such as Claude or ChatGPT.
  • {LABEL} inserts the selected agent’s full label after a copy action.
Keep a placeholder in your override when you want that value to appear. No other placeholders are substituted.

Main copy

data-heading takes precedence over every heading string. An explicit data-string-description takes precedence over each layout-specific description.

Actions and menus

If you set data-verb, it composes the standard labels in English word order. Set data-string-button-label when you need the full label or a different word order; that attribute takes precedence over data-verb.

Status and attribution

data-string-eyebrow, whose default is Agent-optimized, is reserved for a future visible eyebrow label. Current layouts accept the attribute but do not render it.

Translate the widget

Override the copy attributes while keeping the runtime placeholders you need:
The widget’s agent names remain fixed. Translate each surrounding label, menu action, success message, and failure message that can appear in your chosen layout.

Next steps

Enable agent traffic

Add the website signals that help agents discover your storefront directly.

How ZeroClick works

Follow discovery, payment, forwarding, and settlement end to end.