<NULL> Values in Segmentation and Levels (Date-Range Reports)

Null values in segmentation are to be requested in a similar way to <NULL> Values in Global Filters (Date-Range Reports). The same properties that support null in filtering also support null in segmentation.

By default, when segmenting, null values are not included within the segments, since only the values that have been specified in each segment are included. Null values don’t match any regular expression, so the only way to request null values to be included is to specify “includeNull” as true in a similar way to filtering. In segmentation, null values are returned as “<NULL>”. The API considers all cases where the data has never been set from the SDK, set as an empty string, or set as a string containing “<NULL>” to be the same.

The following example requests all values of prodBuild including null:

{

    "level1": {

        "property": "prodBuild",

        "segments": [

            {

                "type": "regex",

                "value": ".*",

                "includeNull": true

            }

        ]

    }

}

In the case of segmentation properties that use sub-properties (os, geography, and gpu), the includeNull value is to be included in the sub-property and applies to that specific sub-property only. In order to be able to include the includeNull property, instead of providing the value as a string or an array of strings, the value of the sub-property must be a JSON object that cointains a property named “value”, and another named “includeNull”. Each of these properties is optional, but at least one of them must be present. The same rules that apply for filtering these types of properties for null values also apply to segmentation.

In the following example, we are requesting segmentation by continent and are also requesting the number of clients where we could not detect the geographical location:

{

    "level1": {

        "property": "geography",

        "segments": [

            {

                "type": "regex",

                "continent": {

                                 "value": ".*",

                                 "includeNull": true

                             }

            }

        ]

    }

}