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
On this page
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:
| Signal | Purpose |
|---|---|
google-adsense-account meta | connects the site to the AdSense account |
| AdSense loader script | enables Auto ads and account-level detection |
root ads.txt | declares 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:
| Variable | Role | Before approval |
|---|---|---|
PUBLIC_ADSENSE_ENABLED | feature switch | true |
PUBLIC_ADSENSE_CLIENT_ID | ca-pub-* account ID | real value |
PUBLIC_ADSENSE_PUBLISHER_ID | pub-* seller ID for ads.txt | real value |
PUBLIC_ADSENSE_SLOT_NEWS_HOME_TOP | manual home slot | empty |
PUBLIC_ADSENSE_SLOT_NEWS_ARTICLE_MID | manual article slot | empty |
PUBLIC_ADSENSE_SLOT_NEWS_ARTICLE_BOTTOM | manual article slot | empty |
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:
- confirm Auto ads settings in AdSense
- create manual display ad units only where needed
- add slot IDs to environment variables
- rebuild and verify the intended
<ins>elements - deploy
- 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
- Connect your site to AdSense
- Where to place AdSense code in your HTML
- Get and copy the AdSense code
- Where to place ad unit code in your HTML
- Ads.txt guide
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. Building domain email with Azure DNS and Zoho Mail
- 2. Running an Azure DevOps self-hosted agent on Synology NAS
- 3. Why a successful Static Web Apps pipeline still returned 404
- 4. Using Azure Repos as the primary source and GitHub as a backup mirror
- 5. Automating NAS agent operations with Slack-based AIOps
- 6. Preventing another news.hwmoon.com article publishing outage
- 7. AdSense readiness operations for news.hwmoon.com
- 8. Fixing news.hwmoon.com deployment outages with self-healing agent healthchecks