Events are used to enhance your visitor data, build audiences, and display ROI for your campaigns. The events can be any interaction on your site that you wish to track, below is a list of the most common ones.
Added to Cart
Initiated Purchase
Completed Purchase
Created account
Logged in
Events can be stand-alone but are usually logged together with the email address that performed the event and the revenue for purchases.
Identification (login email addresses) of your visitors is a crucial part of working with Triggerbee and personalization in general. When you know who your visitors are, you can pinpoint messages toward (or from) them even better.
Note: Did you know that we have templates for event logging and identification with Google Tag Manager? So if you're not tech savvy - check out this guide!
Event API
To log an event, use the triggerbee.event('') method. This automatically associates the event with the current visitor and sends it to Triggerbee. A simple event for a login would look like this:
triggerbee.event({
type: 'goal',
name: 'Logged in'
});
For events that handle email addresses (like logins or purchases), it's best practice to also add identification like this:
triggerbee.event({
type: 'goal',
name: 'Logged in',
data: {
identity: {
email: '[email protected]'
}
}
});
For purchases, use this snippet (Note that type is now "purchase") to also add Revenue and CouponCode for us to be able to attribute campaign interactions and provide ROI (set couponCode to undefined if none was used):
triggerbee.event({
type: 'purchase',
data: {
couponCode: 'welcome15',
revenue: 1500,
identity: {
email: '[email protected]'
}
}
});
Note: Only use dots to separate decimals in the revenue variable.
Correct example:
triggerbee.event({
type: 'purchase',
data: {
couponCode: 'welcome15',
revenue: 1500.0,
identity: {
email: '[email protected]'
}
}
});
Incorrect example:
triggerbee.event({
type: 'purchase',
data: {
couponCode: 'welcome15',
revenue: 1500,0,
identity: {
email: '[email protected]'
}
}
});