Skip to main content

Tracking Goals

Use the track() method to record any actions that your customers perform. Each action is known as a goal and corresponds to a goal_name as defined in the Web Console. Calling track() through the SDKs is the easiest way of getting experimentation data into ABsmartly and allows you to measure the impact of your experiments on your users' actions and metrics. You can also track goals through the integration or by using enrichments to consume them from other event streams and/or databases. In the examples below you can see that the track() method can take up to two arguments. The proper data type and syntax for each are:

  • goal_name: The traffic type of the key in the track() call. The expected data type is String. You should only pass values that match the names of goals that you have defined in the Web Console, everything else will be ignored.
  • properties (Optional): An object of key value pairs that can be used to create extra metrics or to filter the goal.
var properties = {
price: 10000,
category: "5 stars",
free_cancellation: true,
instance_id: 5350,

context.track("booking", properties);