|
| 1 | +# AdSense Delivery Readiness Implementation Plan |
| 2 | + |
| 3 | +> **For agentic workers:** Execute inline in this session; validate with a production build and Playwright browser check. |
| 4 | +
|
| 5 | +**Goal:** Publish the site's ads.txt seller declaration and remove the visible ad frame when AdSense reports no fill. |
| 6 | + |
| 7 | +**Architecture:** Add the exact seller line to Next.js `public/ads.txt`, which exports to the domain root. Observe the rendered AdSense slot's `data-ad-status` attribute and unmount the banner when it becomes `unfilled`. |
| 8 | + |
| 9 | +**Tech Stack:** Next.js static export, React, TypeScript, Playwright CLI. |
| 10 | + |
| 11 | +**Spec:** `docs/superpowers/specs/2026-10-28-adsense-footer-slot-design.md` |
| 12 | + |
| 13 | +## Global Constraints |
| 14 | + |
| 15 | +- Use publisher ID `ca-pub-4334384724173584` and responsive slot ID `8535614411`. |
| 16 | +- Keep the banner responsive and after page content, before the shared footer. |
| 17 | +- Do not treat client code as a substitute for AdSense account activation or site approval. |
| 18 | + |
| 19 | +## Review Focus |
| 20 | + |
| 21 | +- AdSense sets `data-ad-status="unfilled"` asynchronously: observe the attribute and hide the whole banner container. |
| 22 | +- A filled ad remains visible: only hide on the exact `unfilled` status. |
| 23 | +- Next static export serves `/ads.txt` at the root with plain text, not the app fallback HTML. |
| 24 | + |
| 25 | +### Task 1: Publish ads.txt and hide unfilled banner |
| 26 | + |
| 27 | +**Files:** |
| 28 | +- Create: `public/ads.txt` |
| 29 | +- Modify: `src/app/components/AdSenseBanner/index.tsx` |
| 30 | + |
| 31 | +**Interfaces:** |
| 32 | +- The ads.txt line is `google.com, pub-4334384724173584, DIRECT, f08c47fec0942fa0`. |
| 33 | +- The component continues to render only when both existing environment values are configured. |
| 34 | + |
| 35 | +- [x] Check the live failure in Playwright: with `data-ad-status="unfilled"`, the `Publicidade` aside is currently visible. |
| 36 | +- [x] Add the seller declaration and observe slot status changes with a `MutationObserver`; return `null` only after status is exactly `unfilled`. |
| 37 | +- [x] Run `NEXT_PUBLIC_ADSENSE_CLIENT_ID=ca-pub-4334384724173584 NEXT_PUBLIC_ADSENSE_SLOT_ID=8535614411 npm run build`. |
| 38 | +- [x] Serve the static export and verify `/ads.txt` contains the seller line and an unfilled slot hides the whole aside. |
| 39 | +- [x] Commit as `fix(adsense): publish ads.txt and hide unfilled slot`. |
0 commit comments