Skip to main content

What Are Events?

Events represent friction points in your application where users might need help. Each event has:
  • Name: A unique identifier (e.g., checkout_abandoned, signup_stuck)
  • Label: A human-readable display name
  • Description: What this event represents
  • Prompt Template: Instructions for your agent with context placeholders

The Trigger Flow

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   Your Code     │────▶│  Trigger API    │────▶│   Your Agent    │
│                 │     │                 │     │                 │
│ trigger(event,  │     │ Builds message  │     │ Responds with   │
│   context)      │     │ from template   │     │ context         │
└─────────────────┘     └─────────────────┘     └─────────────────┘
  1. Your code detects a friction point and calls boostgpt.trigger()
  2. The API finds the event, builds a message using the template and context
  3. Your agent receives the message and generates a helpful response
  4. The user sees the trigger UI, clicks, and starts a conversation

Context Variables

Context is the data you pass with each trigger. It gets injected into the prompt template.
// Your trigger call
boostgpt.trigger('checkout_abandoned', {
  cart_value: '$149.00',
  items_count: 3,
  user_name: 'Sarah'
});
// Your prompt template
A user named {{user_name}} abandoned checkout with {{items_count}} items
worth {{cart_value}}. Help them complete their purchase.
// Resulting message to agent
A user named Sarah abandoned checkout with 3 items worth $149.00.
Help them complete their purchase.

Auto-Created Events

If you trigger an event that doesn’t exist, it’s automatically created with:
  • Name: The event name you provided
  • Label: Auto-generated from name (e.g., checkout_abandoned → “Checkout Abandoned”)
  • Prompt Template: Default template that includes all context
This lets you start triggering immediately without pre-configuring events.

Event Properties

PropertyRequiredDescription
nameYesUnique identifier (snake_case recommended)
labelNoDisplay name in dashboard
descriptionNoNotes about when/why this event triggers
prompt_templateNoTemplate with {{variable}} placeholders
is_activeNoWhether this event is enabled (default: true)

Best Practices

Names should clearly indicate the friction point:
  • checkout_payment_failed
  • onboarding_step3_stuck
  • event1
  • help_needed
Pass information that helps your agent provide better assistance:
  • Current page or step
  • Error messages (if applicable)
  • User’s progress or history
  • Product/cart details
Templates should give your agent enough context to help immediately:
// Good template
User is stuck on the {{step_name}} step of onboarding.
They've been on this page for {{time_spent}} seconds.
Error shown (if any): {{error_message}}.
Help them proceed.

// Too vague
User needs help with {{step}}.

Event Lifecycle

  1. Created: Event is defined in dashboard or auto-created on first trigger
  2. Triggered: User hits friction point, your code calls boostgpt.trigger()
  3. Logged: Trigger is recorded for analytics (timestamp, context, IP, etc.)
  4. Chat Created: New conversation starts with context-aware first message
  5. Resolved: User gets help, friction point addressed

Next Steps