Skip to main content

Campaign and ad tracking

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 can automatically capture UTM parameters from URLs and populate atomic event properties for campaign analysis.

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

See also media tracking 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.

TrackerSupportedSince versionAuto-trackingNotes
Web1.1.0 (directly), 3.0.0 (as plugin)Requires the ad tracking plugin
iOS
Android
React Native
Flutter
Roku
Google Tag Managerv3

Ad impression event

Track when an ad is displayed to a user.

ad_impression

Event
Schema for an ad impression event
Schema URIiglu:com.snowplowanalytics.snowplow/ad_impression/jsonschema/1-0-0
Example
json
{
"impressionId": "67965967893",
"costModel": "cpm",
"cost": 5.5,
"targetUrl": "http://www.example.com",
"bannerId": "23",
"zoneId": "7",
"advertiserId": "201",
"campaignId": "12"
}
Properties and schema
PropertyDescription
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
Warehouse query
sql
select
unstruct_event_com_snowplowanalytics_snowplow_ad_impression_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), 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

Event
Schema for an ad click event
Schema URIiglu:com.snowplowanalytics.snowplow/ad_click/jsonschema/1-0-0
Example
json
{
"targetUrl": "http://www.example.com",
"clickId": "12243253",
"costModel": "cpm",
"cost": 2.5,
"bannerId": "23",
"zoneId": "7",
"impressionId": "67965967893",
"advertiserId": "201",
"campaignId": "12"
}
Properties and schema
PropertyDescription
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
Warehouse query
sql
select
unstruct_event_com_snowplowanalytics_snowplow_ad_click_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), 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

Event
Schema for an ad conversion event
Schema URIiglu:com.snowplowanalytics.snowplow/ad_conversion/jsonschema/1-0-0
Example
json
{
"conversionId": "743560297",
"costModel": "cpa",
"cost": 10,
"category": "ecommerce",
"action": "purchase",
"property": "",
"initialValue": 99,
"advertiserId": "201",
"campaignId": "12"
}
Properties and schema
PropertyDescription
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
Warehouse query
sql
select
unstruct_event_com_snowplowanalytics_snowplow_ad_conversion_1_0_0
from
PIPELINE_NAME.events events
where
events.collector_tstamp > timestamp_sub(current_timestamp(), interval 1 hour)
and events.event = 'unstruct'
and events.event_name = 'ad_conversion'
and events.event_vendor = 'com.snowplowanalytics.snowplow'

On this page

Want to see a custom demo?

Our technical experts are here to help.