Goals & Events

Goals are used to measure how often users complete specific actions. They represent important events on your website that contribute to the success of your business. Common examples of goals are:

  • Submitted a newsletter popup
  • Adding a product to the cart
  • Completing a purchase
  • Creating an account
  • Logged in
  • Reviewed products

Using and defining goals is a fundamental component of any digital marketing plan because they help you see what's working and what's not. They also help you to segment your visitors. Having properly configured goals allows Triggerbee to provide you with critical information, such as the number of conversions and the conversion rate for your website. Without this information, it's almost impossible to evaluate the effectiveness of your business online and marketing campaigns.

How to use Goals in Triggerbee

Besides measuring the success of your website, goals are a critical part of getting the most out of Triggerbee.

Triggerbee uses Goals to: 

  1. Trigger automatic workflows
  2. Target Campaigns for specific audiences
  3. Create filters in your visitor list and your profiles
  4. Highlight important sessions on your visitor list

You can control almost everything in Triggerbee with Goals, so it's very important that you learn how to use them and work with them.

Different types of goals

All goals have the same visual appearance in Triggerbee. To indicate that a goal has been fulfilled, the visitor will get a badge for each goal. Together with the badge, is the name of the goal.

However, they can come from different types of events. Some goals are automatic (such as the campaign events), and some are custom and can be defined through their URL or button clicks (eg. visiting /checkout/thankyou means that a purchase has been completed). But if you want to log more advanced events you will need to use JavaScript. We recommend that you use Google Tag Manager to set up your Javascript goals. If that is not a possibility, please have your developers read this guide on how to log goals to us via our Javascript API.


How to set up goals

Custom goals can be defined via their URL or through Javascript. Goals can also be logged on events in your campaigns.

Set up a goal via URL/Pathname

  1. Navigate to Customization --> Events
  2. Create a new goal
  3. Give your goal a name, and add the pathname of the URL that you want to trigger this goal. It is possible to work with wildcards to include several paths in your goal.  Use the funnel goal if you want your visitors to have come through a certain path in order to fulfill your goal. 

Log a goal on a button click in your campaign

When creating a campaign, you sometimes have more than one button. By default, Triggerbee will count clicks on both of those buttons to the campaign's total statistics. If you wish to differentiate clicks from each button, you can easily do so by adding a goal to each button - which you can then follow up on in the Visitor feed or Analytics Page. Simply activate the "Log a goal" feature on your button in the campaign editor, and enter a name for your goal.

Set up goals via URL

Goals can be logged through incoming links as well, perhaps if you want to tag specific emails without using UTM-tags. This is simply done by adding utm_goal=yourgoalname to the URL.

Eg: https://www.yourwebsite.com/?utm_goal=clicked_on_my_link


Set up goals via Javascript

Goals can be logged via Javascript in the mtr.goal-event. As a developer, you have complete freedom when it comes to keeping track of important events contributing to your online success. The method accepts the name of the goal and any revenue. 


Examples

mtr.goal("Logged in"); 
mtr.goal("Added to cart"); 
mtr.goal("Completed Purchase", 310); // 310 is the revenue

Note: You do not need to create the goals in the Triggerbee app before logging them via javascript. They are automatically created.


The mtr.goal-event can only be used after the entire Triggerbee tracking script has loaded making the mtr-object available. This is done by utilizing the afterTriggerbeeReady event listener, eg:

window.addEventListener('afterTriggerbeeReady', () => {
     /* do something after Triggerbee has initizalied */
});

Logging Revenue on purchase

For transaction goals (Completed Purchase for instance), you should also log the revenue from that event to Triggerbee - to be able to follow up on how your campaigns are performing revenue-wise in Triggerbee.

Read more about sending order data including setting revenue here.

Adding identity to the goal

When logging goals to Triggerbee, you can also log identification within the same object. This is usually done for all events where any identification is collected, such as when creating accounts, log ins, completed purchases etc. Below is an example! Please read this article for full documentation on how to add identification for your events. 

/* Full example with some logic for identification and revenue */

if (window.location.pathname=="/checkout/thankyou"){
    var tbContact = window.mtr_custom || {};
    tbContact.session = tbContact.session || {};
    tbContact.session.email = document.querySelector('customerEmail').value
    var revenue = parseInt(document.querySelector('totalValue'));
    window.mtr_custom = tbContact;
    mtr.goal('Completed Purchase',revenue);
}

Still need help? Contact Us Contact Us