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

# rpt_ad_attribution_performance_daily

> Daily ad performance with waterfall MTA attribution at ad, ad group, campaign, and channel levels.

> [!NOTE]
>
> **Pro warehouses only.** This table is not delivered on Foundation warehouses. Foundation receives [`obt_purchase_journeys_with_mta_models`](https://docs.sourcemedium.com/docs/data-activation/data-tables/sm_experimental/obt_purchase_journeys_with_mta_models). See [Foundation and Pro](https://docs.sourcemedium.com/docs/data-activation/managed-data-warehouse/overview.md).

This table combines ad-level performance data with multi-touch attribution metrics using a waterfall hierarchy that ensures each dollar flows to the most granular level available.

## Waterfall Attribution Hierarchy

The table implements a true waterfall where attribution flows to the most specific level with data:

| Level | Description | ID Populated |
| - | - | - |
| `ad_level` | Most granular: individual ad performance | `ad_id` present |
| `ad_group_level` | Ad group aggregation when no ad\_id | `ad_group_id` present, `ad_id` null |
| `campaign_level` | Campaign aggregation when no ad\_group\_id | `ad_campaign_id` present, both above null |
| `channel_level` | Channel-only metrics (unattributed remainder) | All IDs null |

> [!NOTE]
>
> Brand campaigns appear in data with spend, impressions, and clicks, but receive **zero attribution** to prevent inflating brand impact metrics.

## Columns

| Column | Type | Description |
| - | - | - |
| `sm_store_id` | STRING | SourceMedium store identifier (brand/workspace). |
| `ad_campaign_id` | STRING | Campaign identifier; populated for campaign\_level, ad\_group\_level, and ad\_level rows, null for channel\_level. |
| `ad_campaign_name` | STRING | Campaign name from the platform; available for campaign\_level and more granular rows. |
| `ad_campaign_tactic` | STRING | Campaign tactic classification: Prospecting, Retargeting, Retention, Brand, Affiliate, or Automatic Targeting. Brand campaigns receive zero attribution. |
| `ad_campaign_type` | STRING | Campaign type classification from the platform (e.g., search, display, shopping, video). |
| `ad_clicks` | INT64 | Signed total ad clicks for the day at the appropriate waterfall level aggregation, preserved exactly from rpt\_ad\_performance\_daily, including negative values reported by the source platform. |
| `ad_creative_image_url` | STRING | URL to the ad creative image for visual reference and creative analysis. |
| `ad_creative_title` | STRING | Ad creative title text for ad-level identification and analysis. |
| `ad_group_id` | STRING | Ad group identifier; populated for ad\_group\_level and ad\_level rows, null for campaign/channel levels. |
| `ad_group_name` | STRING | Ad group name from the platform; available for ad\_group\_level and ad\_level rows. |
| `ad_id` | STRING | Ad-level identifier; populated only for ad\_level waterfall rows, null for higher aggregation levels. |
| `ad_impressions` | INT64 | Signed total ad impressions for the day at the appropriate waterfall level aggregation, preserved exactly from rpt\_ad\_performance\_daily, including negative values reported by the source platform. |
| `ad_name` | STRING | Ad name from the platform; available for ad\_level rows. |
| `ad_platform_campaign_objective` | STRING | Campaign objective set in the ad platform (e.g., conversions, traffic, awareness). |
| `ad_platform_reported_conversions` | FLOAT64 | Platform-reported conversion count; may differ from attribution conversions due to tracking methodology. |
| `ad_platform_reported_revenue` | FLOAT64 | Platform-reported revenue; may differ from attribution revenue due to tracking methodology and attribution windows. |
| `ad_spend` | NUMERIC | Total advertising spend for the day at the appropriate waterfall level aggregation. |
| `date` | DATE | Calendar date for daily aggregation of performance and attribution metrics. |
| `sm_channel` | STRING | Marketing channel classification (e.g., 'Meta', 'Google', 'Impact', 'Amazon'). |
| `sm_first_touch_conversions` | FLOAT64 | Conversion count attributed to first valid non-brand touchpoint; fractional conversions possible for shared attribution. |
| `sm_first_touch_revenue` | NUMERIC | Revenue attributed to first valid non-brand touchpoint in the customer journey; excludes brand campaigns. |
| `sm_last_touch_conversions` | FLOAT64 | Conversion count attributed to last valid touchpoint before purchase; fractional conversions possible for shared attribution. |
| `sm_last_touch_revenue` | NUMERIC | Revenue attributed to last valid touchpoint before purchase; excludes brand campaigns and applies email/sms rules. |
| `sm_linear_conversions` | FLOAT64 | Conversion count attributed using linear model distributing credit evenly across valid touchpoints; fractional values. |
| `sm_linear_revenue` | FLOAT64 | Revenue attributed using linear model distributing credit evenly across valid touchpoints in the customer journey. |
| `source_system` | STRING | Ad platform emitting performance data (facebook, google\_ads, tiktok, amazon\_ads, pinterest, snapchat, microsoft\_ads, impact, refersion, etc.). |
| `waterfall_level` | STRING | Level in the waterfall hierarchy: ad\_level, ad\_group\_level, campaign\_level, or channel\_level. Use to filter or aggregate at the appropriate granularity. |

## Example Queries

### Campaign ROAS by Attribution Model

```sql theme={null}
SELECT
  ad_campaign_name,
  SUM(ad_spend) as total_spend,
  SUM(sm_last_touch_revenue) as last_touch_revenue,
  SUM(sm_first_touch_revenue) as first_touch_revenue,
  SUM(sm_linear_revenue) as linear_revenue,
  SAFE_DIVIDE(SUM(sm_last_touch_revenue), SUM(ad_spend)) as last_touch_roas,
  SAFE_DIVIDE(SUM(sm_linear_revenue), SUM(ad_spend)) as linear_roas
FROM `your_project.sm_experimental.rpt_ad_attribution_performance_daily`
WHERE
  sm_store_id = 'your-sm_store_id'
  AND date BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY) AND CURRENT_DATE()
  AND waterfall_level = 'campaign_level'
  AND ad_campaign_tactic != 'brand'
GROUP BY 1
ORDER BY total_spend DESC
```

### Ad-Level Performance with Attribution

```sql theme={null}
SELECT
  source_system,
  ad_campaign_name,
  ad_name,
  SUM(ad_spend) as spend,
  SUM(ad_clicks) as clicks,
  SUM(sm_last_touch_conversions) as attributed_conversions,
  SUM(sm_last_touch_revenue) as attributed_revenue,
  SAFE_DIVIDE(SUM(sm_last_touch_revenue), SUM(ad_spend)) as roas
FROM `your_project.sm_experimental.rpt_ad_attribution_performance_daily`
WHERE
  sm_store_id = 'your-sm_store_id'
  AND date >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
  AND waterfall_level = 'ad_level'
GROUP BY 1, 2, 3
HAVING spend > 100
ORDER BY attributed_revenue DESC
LIMIT 20
```

### Channel Performance Summary

```sql theme={null}
SELECT
  sm_channel,
  SUM(ad_spend) as total_spend,
  SUM(sm_first_touch_revenue) as first_touch_revenue,
  SUM(sm_last_touch_revenue) as last_touch_revenue,
  SUM(sm_linear_revenue) as linear_revenue
FROM `your_project.sm_experimental.rpt_ad_attribution_performance_daily`
WHERE
  sm_store_id = 'your-sm_store_id'
  AND date >= DATE_SUB(CURRENT_DATE(), INTERVAL 90 DAY)
GROUP BY 1
ORDER BY total_spend DESC
```

## Key Behaviors

### Brand Campaign Handling

Brand campaigns (where `ad_campaign_tactic = 'brand'`) appear in the data with full performance metrics (spend, clicks, impressions) but receive **zero attribution** across all models (first touch, last touch, linear). This prevents brand search from receiving credit that belongs to non-brand touchpoints.

### Channel-Level Unattributed Metrics

Channel-level rows (`waterfall_level = 'channel_level'`) contain only unattributed metrics: spend and performance that couldn't be matched to a specific ad, ad group, or campaign. This prevents double-counting while maintaining complete visibility into marketing spend.

### Amazon and TikTok Shop

Amazon and TikTok Shop channels cannot have SourceMedium attribution since these platforms don't share customer-level conversion data. Platform-reported metrics are available, but `sm_*` attribution columns will be zero.

## Related Resources

> [card] [MTA Models Reference](https://docs.sourcemedium.com/docs/mta/mta-models.md)
>
> Complete guide to all MTA data models including purchase journeys

> [card] [Channel-Level Attribution](https://docs.sourcemedium.com/docs/mta/mta-attribution-rules.md)
>
> Understanding unattributed metrics and channel rollups

> [card] [Ad Performance Daily](https://docs.sourcemedium.com/docs/data-activation/data-tables/sm_transformed_v2/rpt_ad_performance_daily.md)
>
> Base ad performance table without attribution (sm\_transformed\_v2)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.