---
title: "How to Build Cross-Platform Ad Targeting (Lookup, Mapping, and Campaign Creation)"
img: https://s3.us-east-2.amazonaws.com/unified-article-images/how_to_build_cross_platform_ad_targeting_lookup_mapping_and_campaign_creation-icon.png
date: 2026-03-25T00:11:00.000Z
tag: Product
description: "Cross-platform ad targeting means defining who sees your ads across multiple advertising integrations using a consistent approach."
url: "https://unified.to/blog/how_to_build_cross_platform_ad_targeting_lookup_mapping_and_campaign_creation"
---

# How to Build Cross-Platform Ad Targeting (Lookup, Mapping, and Campaign Creation)
------
_March 25, 2026_

Cross-platform ad targeting means defining _who sees your ads_ across multiple advertising integrations using a consistent approach.


In practice, this is one of the hardest problems in advertising systems.


Each integration uses different identifiers, different structures, and different validation rules. You cannot reuse targeting logic across integrations without building custom mapping layers.


This guide shows how to:

- look up valid targeting identifiers
- map targeting into a consistent structure
- apply targeting when creating campaigns and groups
- handle provider differences safely

Using the [Unified Advertising API](https://unified.to/ads).


## Why Ad Targeting Breaks Across Integrations


Targeting is not standardized.


Across integrations:

- **Location IDs differ**
    - Google uses geoTargetConstants
    - Meta uses location IDs
    - TikTok uses category IDs
- **Audience definitions differ**
    - interests, behaviors, custom audiences all vary
- **Supported targeting types vary**
- **Validation rules vary**

This creates a common failure mode:

> You can build campaign creation for one integration, but not for many.

The problem is not campaign creation.


The problem is **identifier lookup and mapping**.


## How Targeting Works in Advertising APIs


Targeting is not applied at the same level everywhere.


### Object structure


| Object   | Role                            |
| -------- | ------------------------------- |
| Campaign | Budget, schedule, status        |
| Group    | Targeting and delivery controls |
| Ad       | Creative                        |
| Target   | Lookup values (IDs)             |
### Key rule

- Targeting is [**readable on campaigns**](https://docs.unified.to/ads/integrations)
- Targeting is **configured primarily at the group level**
- Campaign-level targeting is only supported by some integrations

This distinction matters when building a product.


## Step 1: Look Up Targeting IDs


Before you can define targeting, you need valid identifiers.


Unified provides a lookup endpoint:


```typescript
const targets = await sdk.ads.listAdsTargets({
  connectionId,
  type: 'countries',
  query: 'united',
  limit: 50,
});
```


### Target object


```typescript
type AdsTarget = {
  id: string;
  name?: string;
  value: string;
  type?:
    | 'interests'
    | 'behaviors'
    | 'locales'
    | 'countries'
    | 'regions'
    | 'cities'
    | 'zips'
    | 'us_dmas'
    | 'topics'
    | 'user_lists'
    | 'age_ranges'
    | 'genders';
}
```


### Important

- **Use** **`id`** **when building targeting payloads**
- `name` is for readability
- `value` reflects the provider-specific identifier

## Supported Targeting Types


The lookup endpoint supports:

- Geographic
    - countries, regions, cities, zips, us_dmas
- Demographic
    - age_ranges, genders
- Audience
    - interests, behaviors, topics, user_lists
- Language
    - locales

Support varies by integration.


## Step 2: Map Targeting into a Payload


Once you have IDs, you construct the targeting object.


### Example: Geographic + demographic + audience


```typescript
const targeting = {
  geographic: {
    countries: ['US'],
    regions: [{ id: '3843', name: 'California' }],
  },
  demographic: {
    ageMin: 25,
    ageMax: 54,
    male: true,
    female: true,
  },
  audience: {
    interests: [
      { id: '600313926646746', name: 'Technology' }
    ],
  },
};
```


### Key concept


You are not mapping per integration.


You are using a **consistent structure**, and supplying provider-specific IDs.


## Step 3: Apply Targeting at the Group Level


For most integrations, targeting is applied to the group (ad set / ad group).


```typescript
const group = await sdk.ads.getAdsGroup({
  connectionId,
  id: groupId,
});

await sdk.ads.updateAdsGroup({
  connectionId,
  id: groupId,
  adsGroup: {
    ...group,
    targeting,
  },
});
```


This is the primary targeting workflow.


## Step 4: Campaign Creation with Targeting


Campaign-level targeting is supported only by some integrations.


You can still include targeting in campaign creation:


```typescript
await sdk.ads.createAdsCampaign({
  connectionId,
  adsCampaign: {
    name: 'Spring Campaign',
    status: 'ACTIVE',
    budgetAmount: 5000,
    budgetPeriod: 'DAILY',
    targeting, // applied where supported
  },
});
```


### Important

- Some integrations will apply targeting at campaign level
- Others will ignore it or require group-level configuration

Your product should:

- support both patterns
- default to group-level targeting

## Step 5: Provider Differences


Targeting capabilities vary.


### Examples

- Meta Ads
    - supports most targeting types
- Google Ads
    - supports geographic and interest-based targeting
    - has different placement and optimization behavior
- TikTok Ads
    - supports a subset of targeting types
- Amazon Ads / X Ads
    - may only support countries and locales

### What this means


You must:

- detect available targeting types
- limit UI options accordingly
- handle unsupported cases

## Step 6: Fallback for Unsupported Targeting


If a targeting type is not available through the unified lookup:

- use the [Passthrough API](/passthrough)
- call the integration's native endpoint

This gives you access to provider-specific targeting while still using:

- Unified authorization
- connection management
- consistent request structure

## Step 7: End-to-End Targeting Flow


```typescript
// 1. Lookup targets
const countries = await sdk.ads.listAdsTargets({
  connectionId,
  type: 'countries',
  query: 'united',
});

// 2. Build targeting
const targeting = {
  geographic: {
    countries: [countries[0].id],
  },
};

// 3. Apply to group
const group = await sdk.ads.getAdsGroup({ connectionId, id: groupId });

await sdk.ads.updateAdsGroup({
  connectionId,
  id: groupId,
  adsGroup: {
    ...group,
    targeting,
  },
});
```


This is the minimal cross-platform targeting pipeline.


## Why This Matters


Without a targeting lookup layer:

- you must map IDs per integration
- you must maintain lookup logic per integration
- you must validate targeting per integration

That becomes:

- fragile
- expensive
- difficult to scale

Unified changes this by:

- providing a unified lookup endpoint
- standardizing targeting structure
- allowing reuse across integrations

This removes per-integration mapping logic and reduces maintenance risk .


## Key Takeaways

- Targeting is the hardest part of campaign management
- Each integration uses different identifiers and structures
- Unified provides a lookup endpoint for targeting IDs
- Targeting is primarily applied at the group level
- Campaign-level targeting is integration-dependent
- IDs should always be used for reliability
- Provider differences must be handled explicitly

If you're building campaign creation, optimization, or automation features, this is the layer that determines whether your product can support multiple integrations without custom logic.


→ [Start your 30-day free trial](https://app.unified.to/login)


→ [Book a demo](https://calendly.com/d/cph9-g8n-jzg/connect-with-unified)