# Campaign and ad tracking
> Track marketing campaigns with UTM parameters and ad performance with impression, click, and conversion events for attribution analysis.
> Source: https://docs.snowplow.io/docs/events/ootb-data/campaigns-and-ads/
> Documentation index: https://docs.snowplow.io/llms.txt

Campaign and ad tracking captures how users arrive at your site from marketing campaigns and how they interact with advertisements.

Use campaign and ad tracking to:

- Attribute traffic to specific marketing campaigns
- Measure ad impression and click performance
- Track conversions from ad campaigns
- Analyze the effectiveness of different marketing channels

## Campaign atomic event properties

The [campaign attribution enrichment](/docs/pipeline/enrichments/available-enrichments/campaign-attribution-enrichment/) can automatically capture UTM parameters from URLs and populate [atomic event properties](/docs/fundamentals/canonical-event/#marketing-fields) for campaign analysis.

## Advertisement events

Ad tracking captures impressions, clicks, and conversions from advertisements displayed on your site or elsewhere.

See also [media tracking](/docs/events/ootb-data/media-events/) for tracking advertising content consumed within video or audio media.

This table shows the support for ad tracking across the main client-side [Snowplow tracker SDKs](/docs/sources/).

| Tracker                                                                   | Supported | Since version                       | Auto-tracking | Notes                           |
| ------------------------------------------------------------------------- | --------- | ----------------------------------- | ------------- | ------------------------------- |
| [Web](/docs/sources/web-trackers/tracking-events/ads/)                    | ✅         | 1.1.0 (directly), 3.0.0 (as plugin) | ❌             | Requires the ad tracking plugin |
| iOS                                                                       | ❌         |                                     |               |                                 |
| Android                                                                   | ❌         |                                     |               |                                 |
| React Native                                                              | ❌         |                                     |               |                                 |
| Flutter                                                                   | ❌         |                                     |               |                                 |
| Roku                                                                      | ❌         |                                     |               |                                 |
| [Google Tag Manager](/docs/sources/google-tag-manager/snowplow-template/) | ✅         | v3                                  | ❌             |                                 |

### Ad impression event

Track when an ad is displayed to a user.

### `ad_impression`

**Type:** Event

Schema for an ad impression event

**Properties:**

| Property                | Description                                                                      |
| ----------------------- | -------------------------------------------------------------------------------- |
| `impressionId` _string_ | _Optional._ Identifier for the impression instance                               |
| `costModel` _string_    | _Optional._ The cost model: cpa, cpc, or cpm Must be one of: `cpa`, `cpc`, `cpm` |
| `cost` _number_         | _Optional._ The cost of the impression                                           |
| `targetUrl` _string_    | _Optional._ The destination URL                                                  |
| `bannerId` _string_     | _Optional._ Adserver identifier for the ad banner                                |
| `zoneId` _string_       | _Optional._ Adserver identifier for the zone                                     |
| `advertiserId` _string_ | _Optional._ Adserver identifier for the advertiser                               |
| `campaignId` _string_   | _Optional._ Adserver identifier for the campaign                                 |

**Example warehouse query (Snowflake):**

```sql
select
unstruct_event_com_snowplowanalytics_snowplow_ad_impression_1 ad_impression_1
from
atomic.events
where
events.collector_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'ad_impression'
and events.event_vendor = 'com.snowplowanalytics.snowplow'
```

### Ad click event

Track when a user clicks on an ad.

### `ad_click`

**Type:** Event

Schema for an ad click event

**Properties:**

| Property                | Description                                                    |
| ----------------------- | -------------------------------------------------------------- |
| `targetUrl` _string_    | _Required._ The destination URL                                |
| `clickId` _string_      | _Optional._ Identifier for the click instance                  |
| `costModel` _string_    | _Optional._ The cost model Must be one of: `cpa`, `cpc`, `cpm` |
| `cost` _number_         | _Optional._ The cost of the click                              |
| `bannerId` _string_     | _Optional._ Adserver identifier for the ad banner              |
| `zoneId` _string_       | _Optional._ Adserver identifier for the zone                   |
| `impressionId` _string_ | _Optional._ Links click to impression                          |
| `advertiserId` _string_ | _Optional._ Adserver identifier for the advertiser             |
| `campaignId` _string_   | _Optional._ Adserver identifier for the campaign               |

**Example warehouse query (Snowflake):**

```sql
select
unstruct_event_com_snowplowanalytics_snowplow_ad_click_1 ad_click_1
from
atomic.events
where
events.collector_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'ad_click'
and events.event_vendor = 'com.snowplowanalytics.snowplow'
```

### Ad conversion event

Track when a user completes a conversion action from an ad.

### `ad_conversion`

**Type:** Event

Schema for an ad conversion event

**Properties:**

| Property                | Description                                                    |
| ----------------------- | -------------------------------------------------------------- |
| `conversionId` _string_ | _Optional._ Identifier for the conversion instance             |
| `costModel` _string_    | _Optional._ The cost model Must be one of: `cpa`, `cpc`, `cpm` |
| `cost` _number_         | _Optional._ The cost of the conversion                         |
| `category` _string_     | _Optional._ Conversion category                                |
| `action` _string_       | _Optional._ The type of user interaction, e.g. purchase        |
| `property` _string_     | _Optional._ Describes the object of the conversion             |
| `initialValue` _number_ | _Optional._ How much the conversion is initially worth         |
| `advertiserId` _string_ | _Optional._ Adserver identifier for the advertiser             |
| `campaignId` _string_   | _Optional._ Adserver identifier for the campaign               |

**Example warehouse query (Snowflake):**

```sql
select
unstruct_event_com_snowplowanalytics_snowplow_ad_conversion_1 ad_conversion_1
from
atomic.events
where
events.collector_tstamp > getdate() - interval '1 hour'
and events.event = 'unstruct'
and events.event_name = 'ad_conversion'
and events.event_vendor = 'com.snowplowanalytics.snowplow'
```
