Skip to content
This repository was archived by the owner on May 5, 2026. It is now read-only.

Segment

Benjamin Diolez edited this page May 5, 2026 · 1 revision

Data API / Reporting API v3 / Parameters / Segment

Foreword

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

SECTION DESCRIPTION POSSIBLES VALUES
scope The scope defines which kind of segmentation you will use. Find mode information in the help centre. visit_id user_id visitor_id event_id
segmentKey In case your segment has been saved, you can directly use the key to refers to the segment. String
content Description of the segment. See below
mode Two modes are available to choose if you want to include or exclude the behaviour in your segment. include or exclude
period In case of visitor or user segmentation, define the period on which the behaviour should have been made. See here
space In case of visitor or user segmentation, define the space on which the behaviour should have been made. See here
CONTENT DESCRIPTION VALEURS POSSIBLES
condition The condition contains the filter you want to have in your segment. Can only contain filter
filter The 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"
    }
  },

Wiki contents

Clone this wiki locally