List of Segments


Getting a list of Segments in content enables marketers to serve dynamic content based on a user's segment membership.


Use {% segments segment_names %} in content to fetch all segments that the targeted user is part of. This returns the data strucutured as follows:

{"id":nnn, "name":"sss", "token":"ttt", "type":"static/dynamic"}

Additionally a "map" filter can be used to get a simple array in ZML for ease of operating on this data.

{% segments segment_names | map: "name" %}
{% if segment_names contains "Active"%}
User is a part of Active segment
{% endif %}