Docs / Proactive nudges

Proactive nudges

A proactive nudge is a single, dismissible message that offers real help: a coupon your store actually accepts, or store credit the shopper already has. It is off by default, it never fabricates urgency, and the decision to show it is made server side, not in the browser.

This is the one feature in the plugin that is easiest to turn into spam, so the bar is set high on purpose. A trigger such as idling on the page is allowed to choose when to surface a message, but a trigger alone never produces a nudge. There has to be a grounded value signal that exists right now, or the shopper sees nothing.

The server-side gate

A small PHP helper, Fahad_AI_Proactive, owns the decision. It runs on the server where every rule is unit testable, rather than trusting client JavaScript that could be tampered with. The widget receives, at most, a tiny pre-approved config; it can render that config and enforce the frequency cap, but it can never invent a deal.

A nudge is eligible only when every one of these holds:

If any check fails, the server returns an empty config and the widget gets nothing to show. There is no fallback path that lets a nudge slip through without a grounded reason.

Grounded value signals

The helper resolves a single signal, never two stacked messages. It prefers a coupon over store credit, because a store-wide coupon helps any shopper while credit is per account.

The wallet path only applies when your store has a wallet plugin connected through the provider seam. See Wallet integration for how the balance is read. With no coupon and no positive balance, there is simply nothing to offer, and that is the correct outcome.

When it appears

Triggers choose the moment, never the message. The widget arms a couple of honest, low-friction signals and whichever fires first wins. Opening the chat by any path cancels them, because an engaged shopper does not need an interruption.

None of these fire on page load, and none of them invent value. The signal is grounded on the server before any trigger is armed, so the trigger only decides timing for an offer that already exists.

Frequency cap, dismissal, and memory

The cap bounds how many times a proactive message may appear in a single visit. The default is once per session. Set it to zero to turn proactive messages off without changing anything else.

When a shopper dismisses a nudge, that choice is remembered for the session so it does not reappear. The widget mirrors the server's eligibility check client side and stores the show count plus the dismissal under a stable key in sessionStorage. If storage is blocked by a privacy mode, it degrades to at most once per page rather than looping.

// what the widget remembers, per visitor, under fahad_ai_proactive_v1
{ "shown": 1, "dismissed": false }

The nudge itself is accessible: it is a labelled region announced through a polite live region, both actions are real keyboard-operable buttons, and Escape dismisses it.

No fabricated urgency

The message text is built only from the grounded signal: the real coupon code and its plain description, or the real formatted balance. It states a fact and offers help. It never says hurry, limited time, only a few left, or selling fast. A banned-vocabulary check pins this so scarcity language cannot creep in.

You can use code SAVE10 (10% off) on this order. Want help applying it?
You have $12.00 in store credit. Want to use it on this order?

Turning it on

Open WooCommerce, then Fahad AI, and find the Proactive Assist section.

  1. Tick Proactive Nudges to let the assistant offer a real, applicable deal or unused store credit. It is off until you do this.
  2. Set Max Nudges Per Visit. One is recommended; zero turns proactive messages off.
  3. Save. The nudge will only appear for a shopper when a grounded coupon or positive balance exists at that moment.
A site can adjust or fully suppress the resolved config through the fahad_ai_proactive_config filter without editing plugin code. Returning an empty array suppresses the nudge for that request. See Hooks and filters.

What it never does