Skip to content

Replace AdSense with Adsterra native banner - #9

Merged
thomastschinkel merged 1 commit into
masterfrom
feat/adsterra-native-banner
Aug 31, 2026
Merged

thomastschinkel merged 1 commit into
masterfrom
feat/adsterra-native-banner

Conversation

@thomastschinkel

Copy link
Copy Markdown
Collaborator

Swaps Google AdSense for the Adsterra native banner on the public homepage.

Removed

  • AdSense script (adsbygoogle.js, ca-pub-7071904662816669) from index.html
  • Google ad domains (pagead2.googlesyndication.com, *.googlesyndication.com, googleads.g.doubleclick.net) from the CSP in vercel.json
  • The Google record in public/ads.txt

Added

  • AdsterraNativeBanner component (+ CSS module): injects the Adsterra invoke.js tag via useEffect with async/data-cfasync="false", renders the container-acd496412d230553ca4f4a243557f98c slot, and removes the tag plus clears the slot on unmount (remount/Strict-Mode safe, no duplicate tags)
  • Placed on the landing page only, between BYOKSection and BottomCTA — dashboard, builder, admin and other authenticated pages stay ad-free
  • Adsterra origins allowlisted in CSP script-src/frame-src
  • Adsterra publisher record (31110698) in ads.txt; the 4th field is omitted because the dashboard certification ID isn't known — swap in the exact dashboard line if it has one
  • Collapses the slot if the tag is blocked or fails, so there is no empty gap

Checks: npm run lint (no new warnings), npm run test (285 passed), npm run build (including prerender of 38 routes) all pass, and the prerendered homepage contains the ad container between the BYOK section and the bottom CTA.

Swap the AdSense integration for the Adsterra native banner, loaded from a
reusable React component on the public homepage only.

- remove the adsbygoogle script from index.html and Google ad domains from
  the CSP in vercel.json
- allow the Adsterra script/frame origins in the CSP
- add AdsterraNativeBanner (useEffect script injection, mount/unmount safe)
  between the BYOK section and the bottom CTA
- replace the Google ads.txt record with the Adsterra publisher record
Copilot AI lite review requested due to automatic review settings August 31, 2026 11:48
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openthorn Ready Ready Preview Aug 31, 2026 11:48am

@thomastschinkel
thomastschinkel merged commit 699fa18 into master Aug 31, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR swaps Google AdSense for an Adsterra native banner on the public homepage, updating the UI placement and tightening the surrounding ad-related infrastructure (CSP + ads.txt) to reflect the new provider.

Changes:

  • Removed the AdSense script from index.html and removed Google ad origins from the production CSP.
  • Added an AdsterraNativeBanner component (with CSS module) and rendered it on the landing page between BYOKSection and BottomCTA.
  • Updated public/ads.txt to replace the Google seller record with an Adsterra seller record (with explanatory comments).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vercel.json Updates CSP allowlist to remove Google ad domains and allow Adsterra-related origins.
src/components/AdsterraNativeBanner/AdsterraNativeBanner.tsx Adds the Adsterra native banner component that injects invoke.js and renders the slot container.
src/components/AdsterraNativeBanner/AdsterraNativeBanner.module.css Styles the banner wrapper/label/container and attempts to collapse the slot when empty.
src/App.tsx Places the banner on the public homepage between existing landing-page sections.
public/ads.txt Replaces Google’s ads.txt record with Adsterra’s seller record and adds guidance comments.
index.html Removes the AdSense script include from the base HTML.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +28 to +40
const script = document.createElement('script')
script.async = true
script.setAttribute('data-cfasync', 'false')
script.src = SCRIPT_SRC
script.onerror = () => setFailed(true)
document.head.appendChild(script)
activeScript = script

return () => {
script.remove()
if (activeScript === script) activeScript = null
container.innerHTML = ''
}
Comment thread vercel.json
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; form-action 'self'; script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval' blob: data: https://esm.sh https://pagead2.googlesyndication.com https://*.googlesyndication.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; worker-src 'self' blob:; child-src 'self' blob:; frame-src 'self' blob: data: https://www.youtube-nocookie.com https://googleads.g.doubleclick.net https://*.googlesyndication.com; connect-src 'self' https: wss: blob: data:; manifest-src 'self'"
"value": "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; form-action 'self'; script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval' blob: data: https://esm.sh https://pl31110698.profitableratecpmnetwork.com https://*.profitableratecpmnetwork.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; worker-src 'self' blob:; child-src 'self' blob:; frame-src 'self' blob: data: https://www.youtube-nocookie.com https://*.profitableratecpmnetwork.com; connect-src 'self' https: wss: blob: data:; manifest-src 'self'"
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.

2 participants