Trigger - Segment Event
The Segment Event trigger allows you to start a Flow when an event is triggered in Segment.com. For instance, when a person signs up for your app, you can send them a welcome email.
Note that:
- The Segment Event trigger will not work with events from Ingest API or JavaScript Tracking. For that, please use the Event trigger.
- The Segment Event trigger can fire multiple times. For instance, if you have an event "Task Created" that triggers every time a person creates a task in your product, the step will trigger every time someone creates a task. However, you can use a filter step to end the Flow for people that have already completed the action. Read the last section of this article.
- To learn more about what events are and how to manage them in Encharge, please read our article collection on events.
- To learn more about what Segment is, check the overview article on Segment.
Do not confuse the Segment Event trigger with the Entered Segment trigger:
Connecting Encharge to Segment
For the Segment Event trigger to work, you must integrate Encharge with your Segment account. This process involves technical work, so you must coordinate with your development team. To learn how to implement Encharge and Segment, please read the developer's documentation.
How to set up Segment Event trigger step?
To set up the step, enter the name of the Event in your app. You will see a dropdown of all of the events that are currently in your account. For an event to be selected here, it first must exist in Event Management — however, you can also create a new event from here.
The step will trigger every time someone performs this event (action).
Filtering with event properties
You can optionally add event properties to filter which event is specifically triggered with the step. You can select all existing event properties from a dropdown. Similar to events, event properties must first exist in Event Management to be able to use them.
Event properties are additional attributes that come with events. For instance, the event "Signed Up" might have the properties: "Name", "Email", "Country" (of the person). A "Task created" event might have the properties: "Type of task", "Submission time", and so on.
In the example below, the step will only trigger if the project created is a recurring pro.
To remove an event property click on the trash can on the right of the event name.
How to prevent people from triggering a Segment Event more than once?
The Segment Event trigger can fire multiple times. For instance, if you have an event "Project Created" that triggers every time a person creates a task in your product, the step will trigger every time someone creates a task.
It's currently not possible to prevent people from entering a Segment Event trigger step more than once. However, you can use a filter step to prevent people from continuing in the Flow if they have already performed the event. To do so connect the Segment Event trigger to the Check Condition filter step:
Then, set up the Check Condition step by adding an Event condition and using the name of your event. Note that the Event condition also works events received from Segment.com
Use the "Event count" switch and choose More than 1 time. This will target people that have performed the event 2 or more times:
Finally, connect the Check Condition filter step to an action step. To end the Flow for people that have performed the event more than 1 time connect the Yes link to an End Flow step.
Using a Segment
Another way to prevent a person from entering a Flow more than once when they perform an event multiple times is by creating a Segment with Event condition:
Then in the Flow builder, use the Entered Segment step and connect it to the actions you'd like. With this setup, a person can enter a Segment only once, therefore the step can't be triggered more than once when they perform the action again.
Testing Segment Events
You can learn more about the event by clicking on the More link on the far right.
Using event properties in emails
Each event sends properties with their values that you can later use to personalize emails and flows in Encharge. You can use event properties as dynamic merge tags in emails.
For example, a "Trial started" event might have the "Trial end" property, which contains the end date of the trial of the user. If you want to include this date in an email, you can insert a merge tag that looks something like this: {{event["trial.created"].lastCreated.properties.trialEnd}}
Don't worry, you don't have to write these merge tags manually. Encharge offers an automated merge tag generator. To insert an event merge tag, open an email to edit, click on "Merge tags", then select the object "Events" and set up the event merge tag:
When this merge tag is inserted, it will dynamically populate the trial end date of the user, so each user gets a personalized email with their trial end date.
Use cases
Additional resources and use cases.
- Create a Trigger-Based Email Onboarding Flow for Your SaaS. The Step-by-Step Guide
- How to Set Up a Trial Welcome Email?
- [Webinar] User Onboarding Emails — Examples & Best Practices
- To learn more about what events are and how to manage them in Encharge, please read our article collection on events.