AdSwapX

Adult ad network · Publisher guide

Referer Mismatch: When Your Ad Script Domain Does Not Match

Fix credited impressions blocked by www vs apex, staging domains, CDN proxies, and hotlinking your embed on another adult site.

A referer mismatch ad script domain error blocks credited impressions even when your embed loads perfectly — because the HTTP Referer header on the ad request does not match the hostname you registered with the exchange. www vs apex, staging subdomains, CDN proxies, and hotlinking tags on unauthorized sites all trigger this silent failure mode. This guide shows how to diagnose referer problems and align every URL variant with your verified domain.

AdSwapX embeds send the page URL as referer when requesting fill:

<script async src="https://adswapx.com/embed/YOUR_SITE_KEY.js" data-type="banner"></script>

The exchange compares that referer against your verified site list. Mismatch means no credit — and often no fill. Complete the setup in add ads embed guide before debugging referer issues.

What referer mismatch means for publishers

When a browser loads your page at https://www.example.com/gallery/page-1, ad requests include Referer: https://www.example.com/gallery/page-1 (or the origin, depending on browser). If you verified only example.com without www, the exchange may reject the request. The visitor sees an empty slot; your dashboard shows zero credits.

This protects advertisers from unauthorized inventory on scraped or mirrored sites. It also prevents publishers from accidentally crediting traffic on domains they do not control. Treat referer alignment as part of launch checklist alongside SSL and verification file upload.

www vs non-www: pick one canonical host

Register the hostname your analytics show as primary. If 90% of sessions use www, verify www and 301 redirect apex to www. Embed tags only on canonical URLs. Mixed embedding — some pages www, some apex — splits credits and confuses reporting.

  • Choose canonical host in Google Search Console and Bing Webmaster Tools.
  • Configure Nginx or Apache redirect for the non-canonical variant.
  • Update internal links to canonical host (affects SEO and referer consistency).
  • Re-test verification file on canonical host after redirect changes.

SEO alignment helps monetization: Google Search Console setup and Bing Webmaster Tools should use the same canonical as your ad account.

Staging, dev, and preview domains

Never paste production site_key on dev.example.com, Netlify previews, or local .test domains unless you add each as a separate site entry. Developers often see "working" ads locally that never credit — because referer is localhost. Use mock placeholders in dev templates; inject real tags only in production environment config.

Laravel publishers should store keys in .env and conditionally include partials — see Laravel Blade ad embed guide. WordPress staging plugins that clone URLs can leave hardcoded production domains in widget HTML; audit after migrations.

CDN, reverse proxy, and referer stripping

Some CDN configurations strip or rewrite Referer headers for privacy or misconfigured forwarding. Cloudflare typically preserves referer, but custom Workers or aggressive caching layers may alter request metadata. Nginx reverse proxies must forward $http_referer correctly to origin if ad tags are injected at edge (unusual but possible).

If referer issues began after enabling Cloudflare orange-cloud or new Page Rules, review Cloudflare cache rules for ad scripts and Nginx headers for ad embeds.

Hotlinking embeds on other sites

Pasting your script on a partner forum or mirror site without registering that domain will not credit — by design. Each adult property needs its own verification. Affiliates mirroring your content must use their own site_keys or link out to your canonical URLs instead of embedding your tags.

If you intentionally syndicate widgets, register every hostname or use iframe wrappers the exchange provides (if available). Unauthorized hotlinking also violates most network terms and risks account suspension.

Diagnosing referer in browser DevTools

  1. Open Network tab, load page, filter by embed or ad domain.
  2. Inspect request headers on the ad call — note Referer value.
  3. Compare Referer host to dashboard verified hostname character-for-character.
  4. Fix redirect or registration; purge CDN cache; retest in incognito.

Zero credits with correct referer may indicate viewability or bot filtering instead — see zero credited impressions fix and banner not showing guide.

One site_key per domain — no exceptions

AdSwapX assigns one site_key per verified domain. You cannot share a single key across a network of unrelated adult sites. Multi-site publishers manage multiple entries in one account — each with verification file and embed snippet. This keeps reporting honest and referer checks simple.

Credit economics and multi-site strategy: adult ad exchange guide and monetization roadmap.

Frequently asked questions

What is a referer mismatch for ad embeds?

The HTTP Referer header on the ad request must match the domain you registered. Serving the tag on staging.example.com while verified for www.example.com will not credit. Fix by aligning URLs or registering additional hosts.

Should I register www or non-www?

Register the canonical host visitors use. Redirect the other variant to canonical and embed only on the canonical URLs. Match Search Console property choice for consistency.

Can I use one site_key on multiple domains?

No. Each domain needs its own site entry and verification file. Multi-site publishers add each property separately in the dashboard.

Referer alignment is a five-minute fix that unlocks all downstream monetization work — zones, RPM tests, and credit campaigns. Join AdSwapX, verify your canonical domain, and paste the embed on matching URLs only.