Skip to main content

Getting Started

This walkthrough covers the full lifecycle of a Classify contextual campaign — from creating your first segment to optimizing it based on live performance data.


1. Create a segment

A segment is a curated list of URLs grouped around a topic, interest, or intent. You create one by describing what you want to target.

Send a POST to /v1/clsfy/segment-requests with either a natural language prompt, a set of example URLs, or both:

curl -X POST "https://api.clsfy.me/v1/clsfy/segment-requests" \
-H "X-API-Key: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"name": "Electric Vehicle Enthusiasts",
"prompt": "Pages about electric vehicles, EV reviews, charging infrastructure, and battery technology"
}'

The more specific your input, the more precise the segment. See Segments for guidance on writing effective prompts and choosing seed URLs.


2. Wait for the segment to build

Segment creation is asynchronous. You'll receive an ID immediately, then poll for completion:

curl "https://api.clsfy.me/v1/clsfy/segment-requests/61" \
-H "X-API-Key: <your_api_key>"

Status progresses from pendingprocessingcomplete. Segments typically finish building in 1–2 hours. See Polling for completion for a Python helper.


3. Activate the segment

Once your segment is complete, activate it by specifying which DSP and buyer seat to push it to:

curl -X POST "https://api.clsfy.me/v1/clsfy/activations" \
-H "X-API-Key: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"segment_ids": [61],
"dsp": "The Trade Desk",
"buyer_seat": "seat-abc123"
}'

Classify pushes the segment into the DSP's supply chain and returns a Deal ID — typically within a few hours. See Segment Activation for the full API reference.


4. Set up your campaign in your DSP

Take the Deal ID from the activation response and add it as targeting in your DSP campaign. The exact steps vary by platform — see our DSP Deal ID Guides for walkthroughs:

Before launching, review the Best Practices page — particularly the guidance on keeping targeting lean and including cookieless users.


5. Add the Classify pixel

Attach the Classify pixel to your creatives as an impression tracker. This gives you delivery transparency and post-campaign reporting.

  1. Register a pixel campaign to get a campaign ID
  2. Generate the pixel tag and add it as a tracking tag in your DSP

The pixel fires on every impression and captures the serving domain, URL, and any DSP macros you pass through.


6. Launch and monitor

Once your campaign is live, pull performance reports to see how your segment is delivering:

curl -X POST "https://api.clsfy.me/v1/clsfy/reports" \
-H "X-API-Key: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"segment_ids": [61],
"start_date": "2026-03-01",
"end_date": "2026-03-07",
"dimensions": ["date", "domain"]
}'

Key metrics to watch: impressions, CTR, eCPM, and domain breakdown. Domain-level data shows you which publishers are driving the strongest performance. See Segment Reporting for the full API reference and Performance & Reporting for interpretation guidance.


7. Optimize

Use what you learn from reporting to refine your segment:

  • Expand — found domains or URLs that perform well? Add them to find similar content.
  • Block — seeing low-quality or irrelevant placements? Remove specific URLs, domains, or keywords.
curl -X POST "https://api.clsfy.me/v1/clsfy/optimizations" \
-H "X-API-Key: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{
"segment_id": 61,
"expand": {
"domains": ["electrek.co", "insideevs.com"]
},
"block": {
"domains": ["lowquality-mfa-site.com"]
}
}'

Changes propagate within 2–3 hours. See Segment Optimization for the full API and Optimization Guide for strategy.