Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

rt-config

БесплатноБез исполняемых скриптовНе проверен

Configure RT 2.0 (Real-Time Personalization) for parent segments including event tables, key events, RT attributes, and ID stitching using tdx ps rt commands…

treasure-dataот treasure-data★ 23 звезды на GitHub

Об этом скилле

RT 2.0 Configuration

Configure real-time personalization for parent segments: event tables, RT attributes, batch attributes, and ID stitching.

Prerequisites

  • tdx CLI installed and authenticated
  • Parent segment created in Data Workbench
  • RT 2.0 enabled by CSM (contact CSM if not enabled)
  • Streaming event tables configured and receiving data

Quick Start

# Check RT status
tdx ps view <parent_segment_id> --json

# Initialize configuration template
tdx ps pz init <parent_segment_id> -o rt_config.yaml

# Validate configuration
tdx ps rt validate rt_config.yaml

# Push configuration
tdx ps push rt_config.yaml

Configuration Structure

parent_segment_id: "394649"

# Event tables to track
events:
  - name: "page_view"
    database: "events_db"
    table: "web_events"
    filter:
      field: "td_path"
      pattern: "^/pageview/"

  - name: "purchase"
    database: "events_db"
    table: "commerce_events"
    filter:
      field: "event_type"
      pattern: "^purchase$"

# Real-time attributes
attributes:
  # Single - Latest value
  - name: "last_product_viewed"
    type: "single"
    source_event: "page_view"
    source_field: "product_id"
    aggregation: "last"
    sensitivity: "non-sensitive"

  # List - Array with expiry
  - name: "viewed_products_30d"
    type: "list"
    source_event: "page_view"
    source_field: "product_id"
    aggregation: "distinct_list"
    max_items: 50
    expiry_days: 30
    sensitivity: "non-sensitive"

  # Counter - Event counts
  - name: "purchase_count_7d"
    type: "counter"
    source_event: "purchase"
    window_duration: "7d"
    aggregation: "count"
    sensitivity: "non-sensitive"

  # Imported batch - From parent segment
  - name: "customer_tier"
    type: "imported_batch"
    source: "parent_segment"
    sensitivity: "non-sensitive"

# ID stitching
id_stitching:
  primary_key: "td_client_id"
  stitching_keys:
    - name: "td_client_id"
      exclude_regex: "^test_.*"
    - name: "email"
      exclude_regex: ".*@test\\.com$"
    - name: "user_id"
  ext_lookup_key: "email"

Attribute Types

Single Attributes

Latest or first value from event field:

- name: "last_page_url"
  type: "single"
  source_event: "page_view"
  source_field: "url"
  aggregation: "last"  # or "first", "sum", "min", "max"

List Attributes

Distinct values with expiry:

- name: "browsed_categories"
  type: "list"
  source_event: "page_view"
  source_field: "category"
  aggregation: "distinct_list"
  max_items: 100
  expiry_days: 60

Counter Attributes

Event counts over time window:

- name: "clicks_24h"
  type: "counter"
  source_event: "click"
  window_duration: "24h"  # 24h, 7d, 30d
  aggregation: "count"    # or "sum" with source_field

Imported Batch Attributes

From parent segment (updated on schedule):

- name: "total_lifetime_value"
  type: "imported_batch"
  source: "parent_segment"
  sensitivity: "non-sensitive"

Event Filters

Filter events by field pattern:

events:
  - name: "add_to_cart"
    database: "events_db"
    table: "web_events"
    filter:
      field: "td_path"
      pattern: "^/cart/add"

Common patterns:

  • ^/pageview/ - Starts with /pageview/
  • ^purchase$ - Exactly "purchase"
  • .*product.* - Contains "product"

ID Stitching

id_stitching:
  primary_key: "td_client_id"        # Unique, stable identifier
  stitching_keys:
    - name: "td_client_id"
      exclude_regex: "^test_.*"      # Exclude test IDs
    - name: "email"
      exclude_regex: ".*@example\\.com$"
    - name: "user_id"
  ext_lookup_key: "email"            # External lookup (optional)

Requirements:

  • primary_key must be in stitching_keys
  • All keys should exist in event tables
  • Use exclude_regex to filter invalid values

View Configuration

# View current RT config
tdx ps view <parent_segment_id> --json

# Check event tables
tdx ps view <parent_segment_id> --json | jq '.realtime_config.events'

# List RT attributes (API)
tdx api "/audiences/<parent_segment_id>/realtime_attributes" --type cdp

# List key events (API)
tdx api "/audiences/<parent_segment_id>/realtime_key_events" --type cdp

Update Configuration

Update via API (no YAML update available yet):

# Update event tables
tdx api "/audiences/<parent_segment_id>/realtime_setting" --type cdp --method PATCH --data '{
  "event_tables": [
    {
      "database": "events_db",
      "table": "web_events",
      "event_name": "page_view",
      "filter_field": "td_path",
      "filter_pattern": "^/pageview/"
    }
  ],
  "key_columns": {
    "primary_key": "td_client_id",
    "stitching_keys": ["td_client_id", "email", "user_id"]
  }
}'

# Add RT attribute
tdx api "/audiences/<parent_segment_id>/realtime_attributes" --type cdp --method POST --data '{
  "name": "last_product_viewed",
  "type": "single",
  "source_event": "page_view",
  "source_field": "product_id",
  "aggregation": "
Полный SKILL.md на GitHub

Установить rt-config в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл rt-config?

Configure RT 2.0 (Real-Time Personalization) for parent segments including event tables, key events, RT attributes, and ID stitching using tdx ps rt commands or API

Как установить скилл rt-config?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл rt-config запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить rt-config с