Store offer on geofence entry

The app detects the user near a store and fires a silent event; a rule shows a banner and opens the chat with a discount code and quick replies.

Goal

App → track('geofence_entered', {'store': 'Shibuya'}) (nothing posted) → banner “You are near Acme Shibuya, 10% off today” → tap → chat opens on a prepared turn “Welcome to Acme Shibuya! Show code SHIBUYA10 at the till…” with quick replies.

Pieces

  • SDK: your geofencing code calls Kletso.instance.track('geofence_entered', {'store': storeName}). KletsoNotificationHost is mounted.
  • Rule “Store geofence welcome” (shipped with the sample): kind tracks an event, event geofence_entered, audience everyone, cap 5 per hour. Then: Notify the app with title You are near Acme {{ properties.store }}, body 10% off in store today. Tap to see the code., channel banner, tap opens the chat, auto-dismiss 12 s; and Agent speaks first with the opening text and the quick-replies surface.

Steps

  1. Triggers → Rules: open the rule, adjust the copy, keep it enabled, scope to your environment or all.
  2. In the app, fire the event from your geofence callback. On the Demo page of the sample, the Enter store geofence button does the same.

Verify

  • Triggers → Simulate: track, geofence_entered, { "store": "Shibuya" }, Fire in Development. The right card shows trigger.fired, app.notify, and the streamed opening turn.
  • App: the banner appears above your UI while the chat is closed; the launcher shows an unread dot; tapping the banner opens the chat on the welcome turn.
  • Conversations: the turn is in the user’s conversation with trigger.fired in its timeline.

Notes

  • The frequency cap stops repeated banners when the user walks in and out.
  • Use silent with a local action if you want the app to react (open a store page) without any Kletso UI.
  • Add a condition such as context.plan == 'free' to target only some users.

Last updated 2026-09-28 · Report an issue with this page