> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trytalkvalue.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipe: Channel analysis

> Combine channel-event attribution with audience overlap for a full channel ROI report. All from the CLI.

Run a complete channel ROI report by composing the two read-only channel analyses: per-event attribution (who joined the channel because of which event) and audience overlap (how much each pair of channels shares). The recipe wires [`analysis channel attribution`](/cli/commands/path/analysis/channel-attribution) and [`analysis channel audience`](/cli/commands/path/analysis/audience-overlap) together with `jq` for downstream charting.

<Note>
  **Prerequisites:** authenticated CLI and at least two channels with event registrations. Audience overlap requires between 2 and 5 channel IDs.
</Note>

## Steps

<Steps>
  <Step title="Discover the channels you want to analyze">
    ```bash theme={null}
    talkvalue path channel list --json \
      | jq '.data[] | {id, name, personCount}'
    ```

    Returns every channel with its current member count. Pick two to five IDs for the rest of the script.
  </Step>

  <Step title="Discover the events for attribution scope">
    ```bash theme={null}
    talkvalue path event list --json \
      | jq '.data[] | {id, name, startAt}'
    ```

    Use this when you want to pin attribution to a specific event subset rather than every event the channel touched.
  </Step>

  <Step title="Per-channel attribution across selected events">
    ```bash theme={null}
    CHANNEL_ID=7
    talkvalue path analysis channel attribution "$CHANNEL_ID" \
      --event-id 18 --event-id 22 \
      --json \
      | jq '{
          channel: .data.channel.name,
          channelSize: .data.metrics.channelSize,
          eventParticipationRate: .data.metrics.eventParticipationRate,
          events: (.data.events | map({name, total, joinedSinceLastEvent, acquisitionRate}))
        }'
    ```

    Returns the channel's headline metrics (`channelSize`, `membersEverRegistered`, `eventParticipationRate`) plus a per-event breakdown showing how many new members the channel acquired from each event (`joinedSinceLastEvent`, with `acquisitionRate`) versus people already on the channel (`alreadyInChannel`).

    Omit `--event-id` entirely to roll up every event the channel ever appeared on.
  </Step>

  <Step title="Audience overlap across the channel group">
    ```bash theme={null}
    talkvalue path analysis channel audience \
      --channel-id 7 --channel-id 12 --channel-id 19 \
      --json \
      | jq '{
          channels: (.data.channels | map({name, personCount})),
          intersections: .data.intersections,
          multiChannelRate: .data.metrics.multiChannelRate
        }'
    ```

    Returns each channel's size, every n-way intersection (pairs, triples, and so on), and the aggregate `multiChannelRate`: the fraction of unique people who sit in more than one channel.
  </Step>

  <Step title="Combine into a single report">
    ```bash theme={null}
    CHANNEL_IDS=(7 12 19)
    OUT="reports/channel-analysis-$(date +%Y-%m-%d).json"
    mkdir -p reports

    OVERLAP=$(
      talkvalue path analysis channel audience \
        $(printf -- '--channel-id %s ' "${CHANNEL_IDS[@]}") \
        --json
    )

    ATTRIBUTION="["
    for id in "${CHANNEL_IDS[@]}"; do
      row=$(talkvalue path analysis channel attribution "$id" --json | jq '.data')
      ATTRIBUTION+="$row,"
    done
    ATTRIBUTION="${ATTRIBUTION%,}]"

    jq -n --argjson overlap "$OVERLAP" --argjson attribution "$ATTRIBUTION" \
      '{generatedAt: now | todate, overlap: $overlap.data, attribution: $attribution}' \
      > "$OUT"
    echo "Wrote $OUT"
    ```

    Iterates the channel list, captures each channel's full attribution snapshot, runs one overlap call, and writes a single timestamped JSON file. Drop the loop body into a cron job for a daily archive.
  </Step>
</Steps>

## Variants

### Scope every event analysis to a single tag

```bash theme={null}
talkvalue path analysis channel attribution 7 --tag-id 4 --json \
  | jq '.data.events | map({name, total, joinedSinceLastEvent, acquisitionRate})'
```

`--tag-id` limits the attribution to events that carry the given tag. Useful for "webinars only" or "Q2 campaign only" reports. See [Tags](/path/concepts/tags) and [`tag attach`](/cli/commands/path/tag/attach) for tagging events.

### Spot the largest audience overlap in a trio

```bash theme={null}
talkvalue path analysis channel audience \
  --channel-id 7 --channel-id 12 --channel-id 19 --json \
  | jq '.data.intersections | sort_by(-.count) | .[0]'
```

Returns the single most overlapped n-way slice across the trio. The full intersection list includes every 2-way pair plus the 3-way intersection.

### Track multi-channel rate over time

```bash theme={null}
talkvalue path analysis channel audience \
  --channel-id 7 --channel-id 12 --channel-id 19 --channel-id 25 --json \
  | jq -r '[.data.metrics.multiChannelRate, (now | strftime("%Y-%m-%d"))] | @csv' \
  >> reports/multi-channel-rate.csv
```

Appends a daily row to a long-form CSV. Useful for monitoring how concentrated your audience is becoming over time.

## Tips

* `acquisitionRate` on an event is `joinedSinceLastEvent / total`: the share of the event's audience that the channel acquired specifically because of that event.
* `eventParticipationRate` on a channel is `membersEverRegistered / channelSize`: the share of channel members who registered for at least one event.
* Audience overlap requires `2 ≤ channelCount ≤ 5`. Outside that range, the command exits with a usage error (exit `2`).
* For the dashboard view of the same data, see [Channel attribution](/path/analytics/attribution) and [Audience overlap](/path/analytics/audience).

## See also

* [`analysis channel attribution`](/cli/commands/path/analysis/channel-attribution). Full response schema.
* [`analysis channel audience`](/cli/commands/path/analysis/audience-overlap). Intersection and metric shape.
* [`channel list`](/cli/commands/path/channel/list). Discover channel IDs.
* [`event list`](/cli/commands/path/event/list). Discover event IDs to feed `--event-id`.
* [AI agent skill: recipe-channel-analysis](/cli/agents/skills). Install as a skill.
