Data Types

Numbers

In order to be able to work with your attributes as numbers (e.g. do mathematical operations with them in reports), you need to pass these arguments in following format:

exponea.track('event_name',{
  'numberValue':11.3,
});

Strings

Exponea will handle all quoted attribute as String. Only exception is when you quote an number.

exponea.track('event_name',{
  'stringValue1':'hello world!',
  'stringValue2':'11,4',
  'stringValue3':'[2,3,4]'
});

Objects

In order to create an Object, you need to pass the attributes as follows:

exponea.track('event_name',{
  'object1':{
    'string':'hello world!',
    'number':12
  }
});

Tip: Do not worry if you see [Object object] in Exponea App, you are able to access this object normally in personalization of email, weblayers, etc.

Arrays

If you need to track iterable array of any data types, you need to pass it followingly:

exponea.track('event_name',{
  'array':['hello world!',2,{'num':11}]
  //make sure to pass array as an Object, NOT as a JSON String
});

Dates

If you want to use an attribute as a Date in your reports, you need to send it in UNIX timestamp format.

exponea.track('event_name',{
  'now':Math.round(new Date().getTime()/1000),
  '1st Dec 2017':Math.round(new Date('2017-12-01').getTime()/1000),
  '2st Dec 2017':Math.round(new Date('2017-12-02').getTime()/1000)
});

In addition, you can also use the ISO 8601 format, as it is partially supported in Exponea (offset is not supported). To illustrate, this will work:

2018-8-5 12:20:25
2018-8-5t12:20:25Z
2018-8-5T12:20:25z
2018-8-5 12:20:25Z
2018-8-5 12:20:25.555Z
2018-8-5t12:20:25.555Z

However, this will not function:
2018-8-5T12:20:25+1200
2018-8-5T12:20:25-12:00

You may be using both 5 digits and 3 digits for milliseconds, as the IMF won't take milliseconds into consideration. Nonetheless, both formats will be correctly parsed to seconds.

Updated 6 months ago

Data Types


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.