cja_create_segment
Create a segment in Adobe Customer Journey Analytics using a JSON definition with filtering rules. Provide a name and optional description and data view.
Instructions
Create a new segment in CJA.
This tool creates a new segment/filter that can be used in reports. Segment definitions use a JSON structure to define filtering rules.
IMPORTANT: Segment definitions are complex. Best practice:
Create a template segment in the CJA UI
Use cja_get_segment_details to see its definition structure
Modify the definition as needed
Use cja_validate_segment before creating
Args: name: Segment name (required). definition: Segment definition object with container and rules (required). description: Optional segment description. dataview_id: Optional data view ID (uses configured default if not provided).
Returns: Dictionary with created segment including assigned ID.
Example queries: - "Create a segment for mobile users" - "Make a new filter for high-value customers"
Example definition (mobile users): { "container": { "func": "segment", "context": "hits", "pred": { "func": "exists", "val": {"func": "attr", "name": "variables/mobiledevicetype"} } }, "func": "segment-def", "version": [1, 0, 0] }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| definition | Yes | ||
| description | No | ||
| dataview_id | No |