Skip to content

Add CrawlProof ad units - #2

Merged
ralyodio merged 1 commit into
mainfrom
crawlproof/install-ad-embed-178d4e1e-mtfyw4bo
Aug 30, 2026
Merged

Add CrawlProof ad units#2
ralyodio merged 1 commit into
mainfrom
crawlproof/install-ad-embed-178d4e1e-mtfyw4bo

Conversation

@crawlproof

@crawlproof crawlproof Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

This PR adds the CrawlProof ad units so this site can show network ads and earn crypto for clicks.

  • Slot: 178d4e1e-7970-4d25-ae84-ab1dd4327b23
  • Sizes: banner_300x250, banner_728x90, banner_320x50, text_link
  • Injected all sizes into packages/ui/src/components/layout.ts before </body>. Move or delete any you don't want — empty units simply don't render.

Each unit renders inside a sandboxed iframe and never blocks page load. Manage the slot at https://crawlproof.com/ads/slots

ralyodio added a commit that referenced this pull request Aug 30, 2026
Every placement is now text_link — a fluid 40px bar that carries its own
"Sponsored" mark — and the square formats are gone entirely. The reason is not
taste: every banner creative hard-codes its format's pixel width, so a narrower
column CROPS it rather than reflowing, which makes a 300x250 in a content column
broken on a phone rather than merely ugly.

The obvious alternative — render a desktop banner and a mobile one and hide
whichever does not fit — is wrong and expensive: both fill, and filling is what
meters the impression, so the hidden one burns an impression nobody ever saw. A
server cannot measure the viewport, so it picks one format that works at every
width. banner_728x90 stays available for a board that knows its readers are on
desktop, but it is never the default.

Placements sit at the EDGES: under the forum list, under the topic list, under
the last post. The one position inside the content — between posts — is off
unless an admin asks for it, because it interrupts the only thing anyone came
for. Header and footer bars are available and off.

The unit itself has no chrome: no border, no card, no heading of its own, and a
max width matched to the content column, so it reads as a footnote.

Not merging PR #2. It stacks all four sizes at the bottom of <body> and loads
ad.js from crawlproof.com — which this board's CSP (script-src 'self', no
unsafe-inline) blocks outright, and ad.js renders its creative into a srcdoc
iframe that would inherit that policy and show nothing, silently. The bundled
plugin uses the cross-origin frame endpoint instead, which costs one frame-src
entry and nothing else.

105 tests, 0 type errors.
@ralyodio

Copy link
Copy Markdown
Contributor

Superseded — the slot is live on tsbb.dev, wired through the bundled crawlproof-ads plugin instead of this patch.

Two reasons this particular patch could not be merged as-is:

1. ad.js cannot run on this board. The CSP here is script-src 'self' with no unsafe-inline anywhere (the board ships no client-side JavaScript of its own). ad.js would be blocked outright — and even if it loaded, it injects the creative into a srcdoc iframe, and a srcdoc document inherits the embedder's CSP, so it would render nothing. Silently, with no console error worth noticing.

The plugin uses /api/ads/frame instead: a full cross-origin document with its own policy. Cost to the board is one frame-src entry and nothing else — no script-src, no cookie, no visitor id in our storage. Impressions meter server-side on that path exactly as on the JSON one, so it earns the same.

2. All four sizes stacked at the end of <body>. Every banner creative hard-codes its format's pixel width, so a narrower column crops it rather than reflowing — a 300x250 in a content column is broken on a phone, not just ugly. And rendering several units and hiding the ones that don't fit is worse than it looks: they all fill, and filling is what meters the impression, so the hidden ones burn impressions nobody ever saw.

The plugin serves text_link only — the one fluid format, 40px, carries its own Sponsored mark — placed at the edges of content: under the forum list, under the topic list, under the last post. banner_728x90 is available for desktop-only boards but is never the default.

Slot 178d4e1e-7970-4d25-ae84-ab1dd4327b23 is configured and serving. Nothing else needed from this PR.

@ralyodio ralyodio closed this Aug 30, 2026
@ralyodio ralyodio reopened this Aug 30, 2026
@ralyodio
ralyodio merged commit 3bdb8c9 into main Aug 30, 2026
2 of 4 checks passed
@ralyodio
ralyodio deleted the crawlproof/install-ad-embed-178d4e1e-mtfyw4bo branch August 30, 2026 17:33
ralyodio added a commit that referenced this pull request Aug 30, 2026
PR #2 is merged and stays in the history; this takes out the part of it that
could never have worked here.

The four stacked units and the ad.js tag it added are inert on this board: the
CSP is script-src 'self' with no 'unsafe-inline', so the script is blocked, and
ad.js is what fills those divs — leaving four empty divs at the end of every
page and a blocked request in every console. Two of the formats are also the
fixed-width squares that crop in a content column.

Ads are unaffected: they come from the bundled plugin over the cross-origin
frame endpoint, which needs no script and costs one frame-src entry.

This restores the test that caught it, which is the point of having it — a
future PR adding ad.js will fail the same way rather than quietly shipping a
page with dead markup and no ads.

111 tests, 0 type errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant