Retargeting / Segment Targeting

Retargeting / Segment Targeting

Segment targeting allows you to show ads only to users who belong to a specific audience. One common use case is retargeting—reaching users who previously visited a webpage or took a defined action elsewhere.

Kevel supports two approaches to segment-based targeting:

TypeUse CaseHow It Works
Segment Targeting (Recommended)Target users based on centrally managed segments from Kevel Audience or synced CDPsDefine segments externally (via Kevel Audience or an integrated system) and reference them directly when setting up targeting in your campaign.
Retargeting Segments (Legacy)Track user actions on your site or advertiser’s site to build ad-hoc segments via UserDBUse Ados.js pixels or the UserDB API to manually add users to segments. Then use reserved keys to target users based on stored retargetingSegments in their user profile.

Recommended: Use Segment Targeting

Segment targeting using Kevel Audience or a synced external system is the preferred method. It enables centralized audience management, better reuse across campaigns, and a cleaner setup.

Legacy Retargeting Segment Setup

If you're not using Audience, you can still set up retargeting segments using the JavaScript pixel method or the API. These segments are stored in the user’s UserDB record under retargetingSegments, tied to a persistent userKey.

Retargeting via Ados.js (Pixel Method)

This method allows advertisers to retarget users who visited their site when those users later visit your site.

  1. Create a pixel using the format below.
  2. Provide it to the advertiser to place on their website.
  3. When a user visits that page, the pixel fires and updates the user's UserDB record.
  4. You can then target users in that segment.

Pixel format:

https://e-{networkId}.adzerk.net/udb/{networkId}/rt/{advertiserID}/{segment}/i.gif

Parameters:

FieldDescription
networkIdYour Kevel network ID
advertiserIDThe advertiser’s ID in your network
segmentAn integer segment ID (e.g. 1). You can assign multiple if needed.

Example:

https://e-123.adzerk.net/udb/123/rt/6700/1/i.gif
📘

This method requires you to use Kevel’s Ados.js integration. It does not work with the Decision API.

Retargeting via API

You can also add users to a retargeting segment programmatically by calling the Add to Retargeting Segment endpoint.

This requires:

  • The userKey for the user
  • A numeric segment ID
  • The advertiserId that owns the segment

This is useful if you want to create custom segments based on user activity across your properties (e.g., cart views, product pages, video views).

Alternative: Interest Targeting

If you'd prefer more control or transparency, you can use Interest Targeting instead. Both approaches let you build custom segments, but they differ in expiration behavior:

MethodPersistenceExample Use Case
Retargeting SegmentAuto-expires (~90d)Target recent site visitors
Interest TargetingPersistent unless removed manuallyTrack recurring behaviors or interest over time

Targeting These Segments

When creating a Flight or Ad via the UI or API, you can target users in specific retargeting segments using Reserved Keys.

Use the format:

$user.retargetingSegments.b[AdvertiserID] = [SegmentID]

Example JSON:

{
  "CampaignId": 1234,
  "PriorityId": 1325,
  "Name": "Retargeting - Homepage",
  "StartDateISO": "2017-05-01T00:00:00.00.0000000",
  "GoalType": 1,
  "CustomTargeting": "$user.retargetingSegments.b42 = 1"
}

Viewing Retargeting Segments for a User

To inspect what segments a user belongs to, you can use the Read User endpoint. Look for the retargetingSegments object in the response.

📘

Kevel does not store friendly names for retargeting segment IDs, so you'll need to track what each numeric segment represents (e.g., segment 1 = shopping cart).