Aimtell

Aimtell Documentation

Welcome to the Aimtell documentation hub. You'll find comprehensive guides and documentation to help you start working with Aimtell as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Tracking Custom Events

Custom events allow users to add custom events to their subscribers to be used for segmentation and in turn targeted notifications.

PARTS TO AN EVENT

All events can have up to 4 different pieces of information, while only 2 are required. These are:

1.eventCategory - Required. (string or integer)
2.eventAction - Required (string or integer)
3.eventLabel - Optional. (string or integer)
4.eventValue - Optional. (integer)

HOW TO ADD AN EVENT.

Custom events can be added in two different ways:

1.Via Javascript API
2.Via REST API

ADDING CUSTOM ATTRIBUTES VIA JAVASCRIPT API

Once you have added your website and integrated the tracking code into your site, you are able to start adding custom events. To do so simply call the following snippet on your page, and replace the variables within the parameters with the information you want to track.

Note:

Note: eventCategory and eventAction are required fields while eventLabel and eventValue are optional. eventValue must be a numeric value.

<script>
function _aimtellReady(){
	_aimtellTrackEvent(eventCategory, eventAction, eventLabel, eventValue)	  
}
</script>

Below is an example of tracking a custom event.

<script>
function _aimtellReady(){
	_aimtellTrackEvent("watched video", "tutorial", "welcome to aimtell")
}
</script>

Note

If testing in the console, do not include _aimtellReady part and just paste the _aimtellTrackEvent portion.

The _aimtellReady part is a callback that runs everything inside after the page has fully loaded Aimtell. It is best used if you paste that into the page itself rather than the console.

You may also tie an event to a link or button like this:

<button onclick='_aimtellTrackEvent("watched video", "tutorial", "welcome to aimtell")'>Watch Video Event</button>

ADDING CUSTOM EVENTS VIA REST API

To add a custom event via a REST call check out our documentation at https://aimtell.readme.io/. Essentially you will just need to make an authenticated call and pass the custom event data like the example below. Read our API documentation for more information on responses and limitations.

curl -XPUT -H 'X-Authorization: AUTH_TOKEN' -H "Content-type: application/json" -d '{
    "idSite": "1",
    "owner_uid": "ia123d",
    "eventCategory": "watched video",
    "eventAction" : "tutorial",
    "eventLabel" : "welcome to aimtell"
}' 'https://api.aimtell.com/prod/subscriber/27c2f4e2-8d30-168d-cdcb-69886cb80b79'

VERIFYING EVENTS

To help in debugging event tracking, you can check out your logs under "Logs" -> "Event Logs" within your dashboard.

Tags: create event, create custom event, custom tracking, track event, track custom event

Tracking Custom Events