Skip to content

Commit 8f51935

Browse files
jahoomaclaude
andcommitted
Fix Carbon ad domain display and fire viewable-impression pixel
Carbon's API doesn't expose a destination URL — `statlink` is a 302 tracker to the advertiser — so using it as `url` made the CLI render `srv.buysellads.com` as the ad's domain. Leave `url` empty; clicks still route through `clickUrl`. Also include `statview` (IAB viewable-impression pixel) alongside the advertiser `pixel` entries so viewable impressions actually fire. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ef94e9d commit 8f51935

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

web/src/lib/ad-providers/carbon.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const CARBON_URL_BASE = 'https://srv.buysellads.com/ads'
2424
type CarbonAd = {
2525
statlink?: string
2626
statimp?: string
27+
statview?: string
2728
description?: string
2829
company?: string
2930
callToAction?: string
@@ -108,18 +109,27 @@ export function createCarbonProvider(config: {
108109
const clickUrl = withScheme(first.statlink)
109110
const impUrl = withScheme(first.statimp)
110111

112+
// `statview` is Carbon's IAB viewable-impression pixel (separate from the
113+
// regular impression `statimp`). Our CLI ad is definitively viewable when
114+
// rendered, so fire it alongside any advertiser pixels.
115+
const extraPixels = [
116+
...(first.statview ? [withScheme(first.statview)] : []),
117+
...splitPixels(first.pixel),
118+
]
119+
111120
const normalized: NormalizedAd = {
112121
adText: first.description ?? '',
113122
title: first.company ?? '',
114123
cta: first.callToAction ?? 'Learn more',
115-
// Carbon doesn't return a separate destination URL distinct from
116-
// statlink. Use statlink so DB rows look consistent with Gravity;
117-
// clients click `clickUrl` in both cases.
118-
url: clickUrl,
124+
// Carbon doesn't expose a destination URL — `statlink` is a tracker
125+
// that 302s to the advertiser. Leave `url` empty so the UI doesn't
126+
// render "srv.buysellads.com" as the ad's domain. Clicks use
127+
// `clickUrl` and get correctly routed through tracking.
128+
url: '',
119129
favicon: first.image ?? first.logo ?? '',
120130
clickUrl,
121131
impUrl,
122-
extraPixels: splitPixels(first.pixel),
132+
extraPixels,
123133
}
124134

125135
return { variant: 'banner', ad: normalized }

0 commit comments

Comments
 (0)