Skip to main content

Eventlogging and Identification

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'
});

Or to log more than one event simultaneously:

triggerbee.events([{
type: 'goal',
name: 'Logged in'
}, {
type: 'goal',
name: 'Other Goal'
}]);

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]'
}
}
});

FAQ: Is it possible to send hashed data to Triggerbee?

We advise against hashing email addresses and customer data in the browser. The main reason is that the data is already transmitted securely over HTTPS and is therefore protected in transit. Client-side hashing attempts to solve a problem that is already addressed and does not, by itself, provide any meaningful additional protection.

Why hashing in the browser doesn't help

  • The data is already encrypted. On a website using HTTPS, the data is transmitted over the same encrypted connection as the rest of the website. Anyone intercepting the network traffic cannot read the contents. It is the encrypted connection that protects the data in transit, not the hash.

  • The "secret" is visible. The script runs in the visitor's browser, which means that the hashing method and any salt used can be inspected by anyone using the browser's developer tools. A secret embedded in client-side code is not actually secret.

It does not change GDPR or consent requirements

A hash that can still be linked to an individual is considered personal data under the GDPR. It is a form of pseudonymization, not anonymization. Hashing therefore does not remove any consent requirements under the Swedish Electronic Communications Act (LEK) or the GDPR. You are still processing personal data, with the added risk of mistakenly assuming that you are not.

Did this answer your question?