Emitting Events to Beacon
Emit custom events to Beacon Bar and use them in rules and journeys.
You can enhance the functionality of Beacon Bar by emitting custom events from your app. These events can carry specific information and attributes and can be used to trigger rules and journeys, allowing you to tailor user interactions and experiences.
Emitting a Custom Event
To emit a custom event to Beacon Bar, you can use the Beacon.trackEvent
method. This method takes two parameters:
eventName
(string): The name of the event. Only alphanumeric characters (a-zA-Z0-9), underscores (_), and hyphens (-) are allowed.attributes
(object, optional): An object containing attributes to be passed with the event.
Here's how to use it:
In the example above, we are emitting a custom event with the name 'event_name'
and optional attributes. These attributes can include any additional information you want to associate with the event.
Event Attributes
Event attributes can be used to provide context or additional data to your custom events. For example, you might include user information, timestamps, or specific details related to the event.
Use Cases
Emitting custom events can be beneficial for various scenarios, such as:
Tracking user interactions or actions within your app.
Providing context to Beacon Bar for more personalized responses.
Triggering rules or journeys based on specific user behaviors or events.
By emitting custom events using @beacon.li/bar
, you can create dynamic and engaging experiences for your users, tailoring your support and communication based on their actions.
Important Considerations
When defining custom events and attributes, ensure that you have a clear understanding of the events you want to track and how they align with your app's functionality and user experience.
By following these steps, you can emit custom events to Beacon Bar and use them in rules and journeys to enhance user interactions and engagement.
Last updated