Data types

Bloomreach stores and processes data in several types. The type you assign to an attribute affects how it behaves in filters, reports, and personalization—including what operators are available and how values display in customer profiles.

Numbers

To work with attributes as numbers—for example, in mathematical operations in reports—pass them in the following format:

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

Strings

Bloomreach treats all quoted attributes as strings, except when you quote a number.

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

Booleans

Bloomreach handles true, false, 1, and 0 as Boolean values.

exponea.track('event_name',{
  test1:true,
  test2:false
});

Objects

Pass objects as follows:

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

Note

If you see [Object object] in the app, you can still access the object using Jinja in email or weblayer personalization. Objects aren't accessible with regular filters, so you can't filter data by an object's contents.

Arrays

To track an iterable array of any data types:

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

Dates

🚧

Catalogs only

ISO 8601 date formats work for imports but not for updates via API. Use UNIX timestamp format for catalog item and partial catalog item updates.

To use an attribute as a date in reports, send it in UNIX timestamp format. A string that looks like a date isn't guaranteed to be stored or processed as a date—reliable date behavior requires a UNIX timestamp or a successfully parsed import value.

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

ISO 8601 is partially supported (time zone offsets aren't supported). The following formats work:

2018-08-05 12:20:25
2018-08-05T12:20:25Z
2018-08-05 12:20:25
2018-08-05 12:20:25.555Z
2018-08-05T12:20:25.555Z

The following formats don't work:
2018-8-5T12:20:25+1200
2018-8-5T12:20:25-12:00

All digits are taken into account—there's no rounding to seconds. Milliseconds and microseconds are supported. For example, 2021-08-16T13:03:00.000001Z is stored correctly with all 6 decimal places.


© Bloomreach, Inc. All rights reserved.