Module: events
Find out what events are and how you can send them to User.com
What is an event?
An event is a custom piece of information about something your user does. You can create an event for virtually any action the user can do. Have in mind this means that there are no pre-configured events in the User.com app; you have to create them yourself. Every event is assigned to a user who triggers it and it's visible on his or her timeline along with its attributes. For example, "User clicked the buy now button" or "User filled out a form".
Once you've sent the data to User.com, you can filter users based on these events - allowing you, for example, to send personalized messages to a specific group of people that have performed a given activity.
How to create events?
There are four main ways to create Events:
Send them via GTM, more about it here
Send them via Data collectors, more about it here
Send them straight inside the code, more about it here. Also, below you can find the complete guide on how to install events with the help of the code.
Send them via REST API, more about it here
How to create an event using the code
Simple event binding:
All you need to do is to bind an event on your website. For example, a user clicks on a button which automatically registers the event and sends the data to the system:
<a href="#" onclick="userengage('event.name_your_event_here')">CLICK ME!</a>
Adding Attributes to events
If you want to add an attribute, you can do so by simply setting the second parameter:
<a href="#" onclick="userengage('event.name_your_event_here', {'price': '10'})">CLICK ME!</a>
If you want to addmore attributes, you can do so by setting the second parameter as an object:
<a href="#" onclick="userengage('event.name_your_event_here', {'sku': '7', 'size': '39', 'color': 'teal', 'price': '39'})">CLICK ME!</a>
Adding attribute types
The problem is that the code above stores data as strings. But what if you want to see all the users who have bought blue shoes that cost more than $150? This requires knowing that price as a number.
You can find this by adjusting the type of event attribute (type: number).
First thing (very important!) you need to make sure that you predefined those attributes in user.com app settings: Settings > App settings > User data & events > Event attributes. Here you can add event attributes and define their type.
It's essential to create all of the event attributes with specific types before sending them through users' browsers or REST API. Sending events with events attributes without defined event attributes will result in all of the attributes created as String types, except the JSON field.
Secondly, follow the template below:
<a href="#" onclick="userengage('event.app_created', {
'sku': 7,
'size': 39,
'color': 'teal',
'price': 39
})
/>
As you can see above, only one of these attributes is a String, and others as just numbers.
What information can I store in an event?
Events contain information about:
Date when the event occurred
Title of the event
Additional attributes of different types such as:
Text (string), for example: "Name of the product bought", "Product image URL"
Number, for example: "Price of the product bought (in dollars)", "Number of products in the cart", "Number of agents created"
Date, for example: "Scheduled delivery date", "Date of scheduled contract renewal"
True/False values, for example: "Express delivery checked"
How can I use events?
Events give you flexibility. You can set them to trigger at any user action, and they can be used in many different ways.
Send events by email
Email your users with products they have added to their carts but have not yet purchased. You can even include product attributes such as image or price tag.
Trigger an automation
Actions can be triggered in one of 5 ways. One of them is "Trigger Action". Because events can be generated by an infinite number of user actions, they give you total flexibility as to when you want to trigger your automation.
Filter users
Find your eCommerce or SaaS big spenders. With event information about their purchases, you can, for example, find users who have bought more than five products or have spent more than a certain amount in a single payment.
Get statistics
Keep track of statistics on your events. You can create a data dashboard that contains information about the number of products you have sold in the last 24 hours.
Where can I find the events?
Created events can be found in Filters -> People.
Last but not least, you can take advantage of "Event Triggers" while creating the automation. Simply click on "Trigger" and select the needed event. Done! Now you can gather all the data from the registered activities.