Behavior-Based Triggers

What is a behavior-based trigger?

A behavior-based trigger is a special moment in your product lifecycle which can be leveraged to encourage users to share the product with their networks. These triggers can be associated with completing a specific action, such as inviting team members or reaching an "aha moment"— a moment of delight where users experience significant value or satisfaction while interacting with your product. These moments typically prompt users to feel compelled to share their experience and effectively boost the conversion rate from users to referrers.

How does it work?

When a behavior-based trigger occurs in your product, you can report it to Cello as a MilestoneReached event using our Cello API event. This event will immediately trigger an in-app announcement to the user. Together with Cello, you can define an announcement that will be triggered inside your product. The announcement should encourage the user at this moment to share the product.

Generic event API

To learn more about how to use Generic Event API including authentication, go to Generic Event API guide

Example use case

  • A specific user viewed five presentations

  • You can report that moment to Cello as a MilestoneReached event when the trigger occurs

  • The user will immediately receive an announcement that will encourage them to share


Example Request

To attribute that event and notify the right product user, attach the productUserId to the post requests. Specify the name of the moment as trigger

POST https://api.cello.so/events { "eventName": "MilestoneReached", "payload": { "productUserId": "product-user-id" }, "context": { "event": { "trigger": "five-presentations-viewed" } } }

Name

Type

Description

Required

eventName

string

name of the event. Milestone reached for special moment

Required

productUserId

string

A reference to the Id of the user within your system.

Required

trigger

string

name of the special "aha" moment

Required

Testing Behavior-based trigger and announcement position

While choosing Announcement Selector and choosing its position, you will want to see how it looks and make necessary adjustments. You can trigger an announcement by sending a MilestoneReached event using our Cello API. Below is a simple Python script to trigger such event.

import requests # Authentication endpoint auth_url = "https://api.sandbox.cello.so/token" # Your credentials (replace these placeholders with your credentials for Cello API you can get from Cello Portal: https://portal.cello.so/integrations/accesskeys ) accessKeyId = "YOUR_ACCESS_KEY_ID" secretAccessKey = "YOUR_SECRET_ACCESS_KEY" # Attempt to authenticate and get an API token auth_response = requests.post(auth_url, json={"accessKeyId": accessKeyId, "secretAccessKey": secretAccessKey}) # Check if authentication was successful if auth_response.status_code == 201: api_token = auth_response.json().get("accessToken") print("Successfully obtained API token.") else: print(f"Failed to authenticate. Status code: {auth_response.status_code}, Response: {auth_response.text}") exit() # The URL for the events endpoint url = "https://api.sandbox.cello.so/events" # Event payload data = { "eventName": "MilestoneReached", "payload": { "productUserId": "YOUR_USER_ID" #userId that you use to boot the widget }, "context": { "event": { "trigger": "five-presentations-viewed" } } } # Set the headers including the authorization token headers = { "Authorization": f"Bearer {api_token}", "Content-Type": "application/json" } # Make the POST request to the endpoint with the data and headers response = requests.post(url, json=data, headers=headers) # Check if the request was successful if response.status_code == 200: print("Message sent successfully!") else: print(f"Failed to send message. Status code: {response.status_code}, Response: {response.text}")