segment

Manage CDP child segments with YAML rules and tdx sg commands.

21|24|Updated Oct 21, 2025
One-click install
npx skills add https://github.com/treasure-data/td-skills --skill segment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: segment
Source: https://github.com/treasure-data/td-skills/tree/main/tdx-skills/segment
Command: npx skills add https://github.com/treasure-data/td-skills --skill segment

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines managing CDP child segments using tdx sg with YAML rule configurations. It covers advanced filtering operators, folder organization, and activations for exports to Salesforce/Google Ads.

Core Features & Use Cases

  • YAML-based segment rules with operators (Equal, In, Greater, TimeWithinPast, Contain)
  • Folder structure for organizing segments and reusing rules
  • Activation definitions for connectors and external exports

Quick Start

Start by pulling a parent segment: tdx sg pull "Customer 360", then review and push changes with tdx sg push --dry-run.

Frequently Asked Questions about segment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create child segments in a CDP using YAML rules?

Create child segments by defining YAML rule files with operators like Equal, In, Greater, TimeWithinPast, and Contain, then use `tdx sg push` to apply them. Rules filter audience data based on conditions you specify, enabling precise segment targeting across your CDP.

Can I organize segments into folders and reuse rules across multiple segments?

Yes, the segment workflow supports folder-based organization that lets you group related segments and share rule definitions. This structure simplifies management and reduces duplication when maintaining multiple child segments.

How do I activate segments for Salesforce Marketing Cloud and Google Ads exports?

Define activation blocks in your YAML configuration specifying connectors and export targets. The `tdx sg` commands handle syncing activated segments to Salesforce Marketing Cloud, Google Ads, and other connected platforms automatically.

What commands does the segment workflow provide for managing CDP segments?

The workflow includes `pull` to fetch parent segments, `push` to deploy changes, `dry-run` to preview updates, `delete` to remove segments, `list` to view all segments, `fields` to inspect available attributes, and `show` to display segment details.

Can I validate segment rules before pushing them to production?

Yes, use `tdx sg push --dry-run` to preview all changes without applying them. The workflow also includes error handling and validation to catch rule syntax issues and misconfigurations before activation.

Does this approach work for managing segments at scale across multiple exports?

Yes, YAML-based rules and folder organization scale across Salesforce Marketing Cloud exports, Google Ads exports, and local validation workflows, supporting complex audience structures with centralized rule management.