Event definitions are a simple, developer-free way of tracking events for use in Connect. They are easy to implement, and a great way to get started with Trigger campaigns. If you require more granularity with your events you may want to take a look at tracking events through the REST API, or you can leverage our developer libraries.
An event definition is a way in which an event can be tracked into Connect. Each of your events is created with the default API call event definition, but can have as many or as few definitions as you wish.
This article covers the following topics, relevant to administrators wanting to understand how to configure event definitions:
Viewing your event definitions
After each event is created in Connect a corresponding event entry appears under Settings > Events:
You can view an event’s definitions by selecting the definition value next to the event name:
This new event entry will have a single definition to begin with, which is the API call you may use to trigger this event:
The first method we’re going to look at is Page View which will track the specified event when a user views the specified page.
To use page view definitions
Click Add a new definition, then select Page View:
In this example, we entered the the URL /cart, which means that the event “Item added to cart” will be tracked when when a user visits your website, if the URL ends with /cart. An example of this might look like:
If you wish to have more flexibility in the URL you are targeting, you can use regular expressions in your page URL. Here is an example of a URL that includes a regular expression:
Using the above regular expression along with the URL means that it will match the following:
All without you having to do any extra work outlining definitions. This can also be useful tracking page views across multiple country-specific top level domains or accounting for URL parameters.
Connect also allows you to track an event whenever a user clicks a specific element on your page that has a CSS selector of your choosing.
To use click event definitions
Click Add a new definition, then select the Click Event definition type:
In the above example we've used the /cart page again, but narrowed down user behavior so that in order to track the event "Item added to cart" the user must click on an element on the /cart page that has the CSS selector #add_item.
An example HTML snippet on your page for the above CSS selector might look like:
<input type="text" name="amount" value="0"><br><br>
<input type="submit" value="Add Item">
Finally, Connect will let you fire an event when another event fires without making a code change in your website or app. Let's say your app has different kinds of user accounts. When a user does syncExpenseAccount, you'd also like to fire syncAccount. You can achieve this using the combo event definition.
To use combo event definitions
Go to Settings > Events and click on the number in the definitions column. In our example, we are creating an event definition for the target event, syncAccount.
Next, in the event definition, define the other event which should trigger the target. In our example, this is syncExpenseAccount.
If you choose the a different user option, the combo event will trigger for a different user. To specify this user, you must pick a property of the original triggered event. It's important that the user you message has already been identified with contact information before you trigger the combo event. Otherwise, the user will not exist and we will not have a way to send them a message.