Documentation

Integrate Zyntent

Everything you need to add intent-matched ads to your platform. From quick start to advanced configuration.

Quick Start

Get intent-matched ads running on your platform in under 5 minutes. Add our SDK, configure a surface, and start earning.

Prerequisites

  • A Zyntent account and Site ID
  • A web page or app where you want to display ads
index.html
<!-- 1. Add the SDK to your <head> -->
<script
  src="https://sdk.zyntent.com/v1/zyntent.js"
  data-site-id="YOUR_SITE_ID"
  async
></script>
page.html
<!-- 2. Add an ad surface where you want ads -->
<div
  data-zyntent-surface="chat"
  data-context="auto"
></div>

That's it! The SDK will automatically detect user intent from page context and serve relevant ads. You can customize the surface type, styling, and behavior.

Installation

Choose the installation method that best fits your stack.

Script Tag (recommended)

The simplest way — works with any website or web app.

<head>
<script
  src="https://sdk.zyntent.com/v1/zyntent.js"
  data-site-id="YOUR_SITE_ID"
  async
></script>

NPM Package

For React, Next.js, Vue, and other JavaScript frameworks.

terminal
npm install @zyntent/sdk
app.tsx
import { ZyntentProvider, AdSurface } from '@zyntent/sdk'

export default function App() {
  return (
    <ZyntentProvider siteId="YOUR_SITE_ID">
      <YourApp />
      <AdSurface
        type="chat"
        context="auto"
        position="inline"
      />
    </ZyntentProvider>
  )
}

REST API

For server-side or custom integrations.

server.js
const response = await fetch('https://api.zyntent.com/v1/ads', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    site_id: 'YOUR_SITE_ID',
    surface: 'chat',
    context: {
      query: 'best noise cancelling headphones',
      page_url: 'https://example.com/tech-review',
      user_session: 'sess_abc123',
    },
  }),
})

const { ad } = await response.json()
// ad.headline, ad.description, ad.cta_url, ad.ctr_estimate

Ad Surfaces

A surface is a placement on your page where Zyntent will render an ad. You can have multiple surfaces per page.

surfaces.html
<!-- Chat-style recommendation -->
<div data-zyntent-surface="chat" data-context="auto"></div>

<!-- Search result ad -->
<div data-zyntent-surface="search" data-query="user search query"></div>

<!-- Inline context ad -->
<div data-zyntent-surface="inline" data-context="auto"></div>

<!-- Forum/Q&A ad -->
<div data-zyntent-surface="forum" data-thread-id="thread_123"></div>

<!-- Domain parking -->
<div data-zyntent-surface="domain" data-domain="bestcoffeemachines.com"></div>

Surface Attributes

AttributeTypeDescription
data-zyntent-surfacestringSurface type: chat, search, inline, forum, domain
data-contextstring'auto' or custom context string for intent detection
data-querystringUser's search query (for search surfaces)
data-thread-idstringThread/discussion ID (for forum surfaces)
data-domainstringDomain name (for domain parking surfaces)
data-max-adsnumberMaximum ads to show (default: 1)
data-stylestring'default', 'minimal', 'card', or 'native'

Ad Formats

Each surface type renders ads in a format optimized for that context.

Chat-Style

4-6% CTR

Native recommendations inside AI chat interfaces

Search-Driven

5-6% CTR

Sponsored results in search interfaces

Inline Context

3-5% CTR

Contextual ads embedded in content

Domain Parking

4-6% CTR

AI-generated ads for parked domains

REST API

For server-side integrations, use our REST API to request ads programmatically.

POST /v1/ads

Request an intent-matched ad for a given context.

request.json
{
  "site_id": "site_abc123",
  "surface": "chat",
  "context": {
    "query": "best running shoes for marathon",
    "page_url": "https://example.com/running-guide",
    "user_session": "sess_xyz789",
    "locale": "en-US"
  },
  "options": {
    "max_ads": 1,
    "style": "native",
    "brand_safety": "strict"
  }
}
response.json
{
  "request_id": "req_abc123",
  "latency_ms": 47,
  "ad": {
    "id": "ad_xyz789",
    "headline": "Nike Pegasus 41 — $129.99",
    "description": "Lightweight cushioning built for marathon training. Free shipping + 60-day returns.",
    "cta_url": "https://click.zyntent.com/c/ad_xyz789",
    "cta_text": "Shop Now",
    "sponsor": "Nike",
    "format": "chat",
    "intent_score": 0.94,
    "ctr_estimate": 0.052
  }
}

GET /v1/analytics

Retrieve performance analytics for your site.

analytics.bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.zyntent.com/v1/analytics?site_id=site_abc123&period=7d"

Configuration

Customize SDK behavior via data attributes or the JavaScript API.

config.html
<script
  src="https://sdk.zyntent.com/v1/zyntent.js"
  data-site-id="YOUR_SITE_ID"
  data-theme="dark"
  data-brand-safety="strict"
  data-max-ads-per-page="3"
  data-locale="en-US"
  data-debug="false"
  async
></script>
config.ts
// JavaScript API configuration
window.zyntent?.configure({
  theme: 'dark',            // 'light' | 'dark' | 'auto'
  brandSafety: 'strict',    // 'strict' | 'standard' | 'permissive'
  maxAdsPerPage: 3,
  locale: 'en-US',
  onAdLoad: (ad) => {
    console.log('Ad loaded:', ad.id, ad.headline)
  },
  onAdClick: (ad) => {
    console.log('Ad clicked:', ad.id)
  },
  onError: (error) => {
    console.error('Zyntent error:', error.message)
  },
})

Analytics

Track performance in real time via our dashboard or API.

Available Metrics

Impressions

Total ads shown

Clicks

Total ad clicks

CTR

Click-through rate

Revenue

Total earnings

eCPM

Effective CPM

Fill Rate

Ads served / requested

Latency

Avg ad load time

Intent Score

Avg intent confidence

analytics-response.json
{
  "period": "7d",
  "impressions": 1247832,
  "clicks": 62391,
  "ctr": 0.05,
  "revenue_usd": 18426.50,
  "ecpm": 14.76,
  "fill_rate": 0.94,
  "avg_latency_ms": 43,
  "avg_intent_score": 0.87
}

Need help?

Our engineering team is here to help you integrate. Reach out and we'll get you set up.

Contact Engineering