Operations 10 min read Intermediate

AdSense readiness operations for news.hwmoon.com

How news.hwmoon.com handles Google AdSense review readiness, ads.txt, account metadata, manual ad unit slots, hidden placeholders, and the approval-to-serving transition.

Google AdSense
Site review flow
Astro
Static rendering
Azure Static Web Apps
Production deploy
Analytics dashboard screen representing AdSense readiness checks and publishing site verification
자료 이미지: Photo by 1981 Digital on Unsplash
On this page
  1. What Was Ready
  2. What Was Not Ready
  3. Rendering Rule
  4. Environment Variables
  5. QA
  6. Approval Transition
  7. References

This note documents how news.hwmoon.com handles Google AdSense readiness before the site is approved for ad serving.

The important distinction is that AdSense setup has multiple states. ads.txt can be accepted while the site itself is still under review. The account code can be present in the <head> while no real ads are served yet. Manual ad units also require slot IDs; without those IDs, rendering empty ad boxes only hurts the public experience.

The operating decision is:

Keep the review signals visible to Google. Do not show blank ad slots to readers before approval.

What Was Ready

The site already had the two core review signals:

SignalPurpose
google-adsense-account metaconnects the site to the AdSense account
AdSense loader scriptenables Auto ads and account-level detection
root ads.txtdeclares the authorized Google seller line

The live root file returned:

google.com, pub-7343727257014985, DIRECT, f08c47fec0942fa0

That means seller declaration was ready. It did not mean the site was approved for serving.

What Was Not Ready

The AdSense console still showed the site as preparing for review. There were also no manual ad unit slot IDs configured yet.

That means public pages should not render manual <ins> elements. A blank ad box is not useful to the review process, and it makes the site look unfinished.

Rendering Rule

The AdSenseSlot component renders only when all required values are valid:

const shouldRender = adsenseEnabled && hasValidClientId && hasValidSlotId;

Before approval:

account meta: present
loader script: present
ads.txt: present
manual ad slot element: absent
blank placeholder: absent

After approval and slot creation:

account meta: present
loader script: present
ads.txt: present
manual ad slot element: present only where configured

This keeps the site review-ready without exposing empty UI.

Environment Variables

The variables are separated by responsibility:

VariableRoleBefore approval
PUBLIC_ADSENSE_ENABLEDfeature switchtrue
PUBLIC_ADSENSE_CLIENT_IDca-pub-* account IDreal value
PUBLIC_ADSENSE_PUBLISHER_IDpub-* seller ID for ads.txtreal value
PUBLIC_ADSENSE_SLOT_NEWS_HOME_TOPmanual home slotempty
PUBLIC_ADSENSE_SLOT_NEWS_ARTICLE_MIDmanual article slotempty
PUBLIC_ADSENSE_SLOT_NEWS_ARTICLE_BOTTOMmanual article slotempty

The slot variables should remain empty until AdSense provides real ad unit IDs.

QA

Before deployment, the build and audit should confirm:

meta tag exists
loader script exists
ads.txt returns 200
manual ad slot DOM count is zero before slot IDs
placeholder DOM count is zero

After deployment, the same checks should be run against the live site. Static builds can pass locally while a stale deployment remains live, so production HTML matters.

Approval Transition

When AdSense changes the site to a serving-ready state:

  1. confirm Auto ads settings in AdSense
  2. create manual display ad units only where needed
  3. add slot IDs to environment variables
  4. rebuild and verify the intended <ins> elements
  5. deploy
  6. check mobile layout, CLS, and report data over the next 24-48 hours

The safest first placement is a low-disruption article location, such as article bottom or middle. Top-of-article ads should be added only after layout behavior is observed.

References

The practical rule is simple: review code stays, empty slots do not. Ad serving begins only after approval and real slot IDs exist.

Series

Publisher Infrastructure

Part 7 of 8. This series collects related build notes so the context is easier to follow later.

  1. 1. Building domain email with Azure DNS and Zoho Mail
  2. 2. Running an Azure DevOps self-hosted agent on Synology NAS
  3. 3. Why a successful Static Web Apps pipeline still returned 404
  4. 4. Using Azure Repos as the primary source and GitHub as a backup mirror
  5. 5. Automating NAS agent operations with Slack-based AIOps
  6. 6. Preventing another news.hwmoon.com article publishing outage
  7. 7. AdSense readiness operations for news.hwmoon.com
  8. 8. Fixing news.hwmoon.com deployment outages with self-healing agent healthchecks

Related