Skip to main content

Ads & monetization

This site supports Google AdSense on documentation pages to offset domain and hosting costs. Layout slots are reserved; no ads render in production until environment variables are set.

Ad placements

PlacementVariableNotes
Above article bodyADSENSE_SLOT_ARTICLE_TOPBelow breadcrumbs
Below article bodyADSENSE_SLOT_ARTICLE_BOTTOMAbove footer prev/next
Right sidebarADSENSE_SLOT_SIDEBARDesktop only, when TOC is shown

Development builds show dashed placeholder boxes so you can preview layout without live ads.

Setup

  1. Register at Google AdSense and pass site review.
  2. Obtain your publisher ID and slot IDs (see .env.example in the repo root).

Apex domain vs. doc. subdomain

TopicGuidance
Live docs URLhttps://doc.abcreatoris.com (must match url in docusaurus.config.ts)
What to add in AdSense SitesUsually the apex abcreatoris.com only—you often cannot add doc.abcreatoris.com as a separate site
Serving on subdomainsAfter apex verification, subdomains such as doc. are typically covered under the same publisher account
ads.txt / scriptStill hosted on the doc subdomain (e.g. https://doc.abcreatoris.com/ads.txt) on this Vercel project

If the console shows apex Ready but doc. stays data-ad-status="unfilled" for days, it is often inventory or Auto ads conflicting with manual units—not necessarily a code bug.

Connect your site (AdSense onboarding)

After AdSense approval, the console shows Connect your site to AdSense. This repo already ships the script and ads.txt; you only need the correct URL in the console and time for Google to crawl.

URL to enter in AdSense

FieldCorrect valueCommon mistake
Site URLhttps://abcreatoris.com (apex) per console prompts; docs run on doc.abcreatoris.comWrong subdomain (docs.), adding an unsupported separate subdomain entry, paths like /docs/intro, or http://
Publisher IDca-pub-2085315988106926Same account as pub-2085315988106926 in ads.txt

Post-deploy verification

After deploying to Vercel, confirm all three are publicly reachable:

  1. AdSense script (site-wide <head>)
    View source on the homepage and any doc page (e.g. /docs/intro). You should see:

    <script src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2085315988106926" async crossorigin="anonymous"></script>

    Injected via scripts in docusaurus.config.ts on every page including the homepage.

  2. ads.txt at domain root
    https://doc.abcreatoris.com/ads.txt should return:

    google.com, pub-2085315988106926, DIRECT, f08c47fec0942fa0

    Source file: static/ads.txt (copied to site root at build time).

  3. robots.txt
    This site does not block Google. If you add robots.txt later, do not Disallow / or /ads.txt.

Console steps

  1. Sign in to AdSenseSites.
  2. Add site or Connect site for the pending property.
  3. Enter https://abcreatoris.com (apex, no path) when the console only accepts the root domain.
  4. If asked to paste code: the script is already deployed—choose I've placed the code.
  5. Wait for Google to crawl (hours to 48 hours). Status Ready / connected means done.

Common connection failures

SymptomLikely causeFix
AdSense code not foundScript missing or ADSENSE_CLIENT not set at buildSet Vercel env vars and Redeploy
Invalid / 404 ads.txtstatic/ads.txt not in deploymentDeploy latest commit; open /ads.txt
URL mismatchWrong subdomain or path in consoleUse https://doc.abcreatoris.com
Site unreachableDNS, HTTPS, or deploy issueConfirm homepage loads with no login wall
Stuck on PendingCrawl not finishedWait 24–48h, then Check status in AdSense

Production (Vercel)

This site is deployed on Vercel. AdSense values are injected at build time—configure them in the Vercel dashboard:

  1. Open Vercel Dashboard → select this project → SettingsEnvironment Variables.
  2. Add these four variables (Production; optionally mirror them on Preview / Development for branch previews):
VariableDescription
ADSENSE_CLIENTAdSense publisher ID (ca-pub-…)
ADSENSE_SLOT_ARTICLE_TOPSlot for above-article placement
ADSENSE_SLOT_ARTICLE_BOTTOMSlot for below-article placement
ADSENSE_SLOT_SIDEBARSlot for sidebar placement
  1. Redeploy after saving (Deployments → latest deployment → Redeploy, or push a new commit). Changes do not apply until the next build.
warning

Do not commit .env to Git. It is listed in .gitignore.

Local development

Copy .env.example to .env and fill in the variables above. docusaurus.config.ts loads .env at build time via dotenv.

npm run build

Compliance & UX

  • If you use the manual ad units above, turn off Auto ads (Site → Auto ads → disable all formats). Auto ads inject extra <ins> elements that steal push({}) from manual units—often you only see the “Ad” label and the bottom slot never fills.
  • This site is a Docusaurus SPA: src/theme/Root.tsx and AdSlot re-request fills on client-side navigation. After deploy, hard-refresh and click between doc pages to verify all three slots.
  • Right after apex becomes Ready, doc. may stay unfilled for hours or days while inventory ramps up.
  • Disclose cookies and ad partners in your privacy policy or a dedicated page.
  • For investing and health content, avoid ad copy that could be mistaken for editorial advice; ad blocks are labeled “Ad”.
  • If AdSense review fails, alternatives such as Carbon or EthicalAds are possible—you would adapt src/components/AdSlot.

Disabling ads

Remove ADSENSE_CLIENT or leave it empty, then redeploy; the build will not load the AdSense script site-wide.