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}).KletsoNotificationHostis 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 titleYou are near Acme {{ properties.store }}, body10% 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
- Triggers → Rules: open the rule, adjust the copy, keep it enabled, scope to your environment or all.
- 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 showstrigger.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.firedin its timeline.
Notes
- The frequency cap stops repeated banners when the user walks in and out.
- Use
silentwith alocalaction 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.