Segment

 

Foreword

The parameter segment describes the context of the segment. It is composed of different parameters:

SECTIONDESCRIPTIONPOSSIBLES VALUES
scopeThe scope defines which kind of segmentation you will use. Find mode information in the help centre.visit_id user_id visitor_id event_id
segmentKeyIn case your segment has been saved, you can directly use the key to refers to the segment.String
contentDescription of the segment.See below
modeTwo modes are available to choose if you want to include or exclude the behaviour in your segment.include or exclude
periodIn case of visitor or user segmentation, define the period on which the behaviour should have been made.See here
spaceIn case of visitor or user segmentation, define the space on which the behaviour should have been made.See here
CONTENTDESCRIPTIONVALEURS POSSIBLES
conditionThe condition contains the filter you want to have in your segment.Can only contain filter
filterThe filter describes all the behaviour you want to follow.See here
 

Examples:

// Segment on the device type "Desktop"
"segment": {
    "section": {
      "scope": "visit_id",
      "content": {
        "condition": {
          "filter": {
            "device_type": {
              "$eq": "Desktop"
            }
          }
        }
      },
      "mode": "include"
    }
  },

# Segment on the device type "Desktop"
"segment": {
    "section": {
      "scope": "visit_id",
      "content": {
        "condition": {
          "filter": {
            "device_type": {
              "$eq": "Desktop"
            }
          }
        }
      },
      "mode": "include"
    }
  },

# Segment on the device type "Desktop"
"segment": {
    "section": {
      "scope": "visit_id",
      "content": {
        "condition": {
          "filter": {
            "device_type": {
              "$eq": "Desktop"
            }
          }
        }
      },
      "mode": "include"
    }
  },

# Segment on the device type "Desktop"
"segment": {
    "section": {
      "scope": "visit_id",
      "content": {
        "condition": {
          "filter": {
            "device_type": {
              "$eq": "Desktop"
            }
          }
        }
      },
      "mode": "include"
    }
  },