Skip to content

Commit 1bf585d

Browse files
ralyodioclaude
andauthored
ads: surface the Text Link size on the Monetize page (#98)
Add the native, full-width text-link ad to the publisher size picker. Unlike the banners, text_link predates the ad_slots.formats default, so a migration widens the default and backfills existing slots — otherwise serveAd() would gate it out and the copied embed would never fill. - lib/ads/formats.ts: add text_link to PUBLISHER_FORMAT_IDS - supabase/migrations: allow text_link on ad_slots.formats (+ backfill) Note: prod migration history has diverged, so this must be applied by hand via psql over the pooler (see the crawlproof-alerts runbook), not `supabase db push`. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 530d03d commit 1bf585d

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎lib/ads/formats.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const PUBLISHER_FORMAT_IDS: AdFormatId[] = [
2323
"banner_300x250",
2424
"banner_728x90",
2525
"banner_320x50",
26+
"text_link",
2627
];
2728

2829
export function formatSpec(id: AdFormatId) {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- Allow the native text-link ad to serve on publisher slots.
2+
--
3+
-- ad_slots.formats gates which sizes serveAd() will fill for a slot, and its
4+
-- original default predates the text_link format:
5+
-- default array['banner_300x250','banner_728x90','banner_320x50']
6+
-- So a publisher who copies the new text-link embed would get nothing back.
7+
-- Widen the default for new slots and backfill existing ones so their
8+
-- text-link embed actually fills.
9+
10+
alter table public.ad_slots
11+
alter column formats
12+
set default array['banner_300x250', 'banner_728x90', 'banner_320x50', 'text_link'];
13+
14+
update public.ad_slots
15+
set formats = array_append(formats, 'text_link')
16+
where not ('text_link' = any (formats));

0 commit comments

Comments
 (0)