Publisher docs

Publisher integration guide

Add AdFanz creator ads to your site with simple script tags, category targeting, controlled fallback, and billable click tracking.

01

Quick start

Replace PUB_KEY with your publisher key, set data-category based on the section or page, and paste the script where the ad should appear.

<script src="https://api.adfanz.com/widget.js" data-publisher="PUB_KEY" data-category="cosplay"></script>
02

Ad formats

Image Card

A compact creator card for inline, sidebar, and content placements. It uses approved image media and tracks clicks through AdFanz.

Video Card

The same compact placement style, but with a muted short preview video. Video views are not billable clicks.

Popover

A publisher opt-in interstitial that appears after a delay, includes a close button, and never uses forced redirects.

Video Pre-roll

A muted beta video ad that can appear before a publisher video player and shows a skip button after the configured delay.

03

Embed examples

Image/video card

<script src="https://api.adfanz.com/widget.js" data-publisher="PUB_KEY" data-category="cosplay"></script>

Image card explicit

<script src="https://api.adfanz.com/widget.js" data-publisher="PUB_KEY" data-category="cosplay" data-format="image_card"></script>

Video card

<script src="https://api.adfanz.com/widget.js" data-publisher="PUB_KEY" data-category="cosplay" data-format="video_card"></script>

Popover

<script src="https://api.adfanz.com/popover-widget.js" data-publisher="PUB_KEY" data-category="cosplay" data-delay-seconds="5" data-frequency="session"></script>

Pre-roll

<script src="https://api.adfanz.com/preroll-widget.js" data-publisher="PUB_KEY" data-category="cosplay" data-video-selector="#main-video" data-skip-after="5"></script>
04

Category targeting

data-category is the main placement category. Your publisher site must allow that category, and the campaign must include the same category. For example, a MILF section should use data-category="milf".

If no eligible campaign matches the exact category, no ad is served by default.

05

Optional tags

data-tags can help prioritize better matches, but tags do not replace data-category. A cosplay page can use category targeting plus extra tags like anime or gamer.

<script src="https://api.adfanz.com/widget.js" data-publisher="PUB_KEY" data-category="cosplay" data-tags="anime,gamer"></script>
06

Controlled fallback

Fallback is disabled by default. Exact no-match returns no ad. Use data-fallback="true" to allow fallback to another publisher-approved category, or data-fallback-categories to control fallback order.

Fallback never uses categories your publisher site has not approved.

<script src="https://api.adfanz.com/widget.js" data-publisher="PUB_KEY" data-category="cosplay" data-fallback="true"></script><script src="https://api.adfanz.com/widget.js" data-publisher="PUB_KEY" data-category="cosplay" data-fallback-categories="anime,gaming"></script>
07

Pre-roll setup

data-video-selector should point to the publisher video element. For example: data-video-selector="#main-video".

If no video element is found, AdFanz fails safely and does not block the page. The skip button appears after data-skip-after seconds.

08

Beta payouts

Payouts are manual during beta. Earnings are based on billable clicks only. Duplicate, suspicious, or invalid clicks are non-billable, and admin review may hold or void suspicious payouts.

09

Publisher rules

  • No self-clicking
  • No bot traffic
  • No hidden widgets
  • No forced redirects
  • No malware pages
  • No click farms
  • No misleading placements
10

Troubleshooting

Widget not showing

Confirm your site is approved, your publisher key is correct, and the script is not blocked by the browser or an ad blocker.

Exact category has no matching ads

AdFanz returns no ad by default when the requested category has no eligible campaign.

Fallback not enabled

Add data-fallback="true" or data-fallback-categories="anime,gaming" if you want controlled fallback.

Wrong publisher key

Use the publisher key generated for the approved site where the widget is installed.

Site not approved yet

Widgets only serve live ads for approved publisher sites.

Script blocked

Some browsers, extensions, or network filters can block ad scripts during testing.

Pre-roll selector wrong

Set data-video-selector to the CSS selector for your actual video element, such as #main-video.

Publisher beta

Ready to install AdFanz?

Create a publisher site, copy your publisher key, and add the right script tag to your placement.