Ads & Monetization
Monetize your blog with Google AdSense. Display ads on your content and track earnings directly in your dashboard.
On This Page
Overview
Add your Google AdSense Publisher ID and Postlyo handles the rest—script injection, ads.txt generation, and placement. Track your earnings directly in your dashboard.
Auto Ads or Manual Control
Let Google optimize placements, or specify exact positions yourself.
Auto Ads.txt Generation
Postlyo creates and serves your ads.txt automatically.
In-Dashboard Earnings
View revenue, clicks, and RPM without leaving Postlyo.
One-Click Toggle
Turn ads on or off instantly—no code changes needed.
Two separate configurations
Earnings Tracking (Settings → Analytics) – shows revenue in your dashboard.
Getting Started with AdSense
Requirements
Before you can display ads, you need:
An approved AdSense account
Apply at google.com/adsense. Google reviews your site before approval.
Quality content
Google requires original, valuable content. Have at least 10-15 posts before applying.
Your Publisher ID
Once approved, you'll get a Publisher ID (format: ca-pub-XXXXXXXXXXXXXXXX).
AdSense approval takes time
Finding Your Publisher ID
Log in to AdSense
Go to google.com/adsense and sign in.
Open Account Settings
Click Settings → Account → Account information.
Copy your Publisher ID
Find your Publisher ID. It looks like ca-pub-1234567890123456.
Configuring Ads
Go to Settings → Ads to configure how ads appear on your blog.
Auto Ads
Auto Ads is the simplest way to display ads. Google automatically places ads in optimal positions on your pages.
Auto Ads Setting
Recommended for most users
Enable Ads
Show ads on your blog
Auto Ads
Let Google place ads automatically
Start with Auto Ads
Manual Placements
For more control, you can specify exactly where ads appear using ad slot IDs.
Ad Slot Settings
Manual placement configuration
Above the content
Within post content
In the sidebar
Below content
Creating Ad Slots
Go to AdSense
Open your AdSense account.
Create an ad unit
Go to Ads → By ad unit → Display ads → Create.
Configure the unit
Give it a name (e.g., "Blog Header") and choose responsive size.
Get the slot ID
After creating, you'll see code. Find the data-ad-slot value – that's your slot ID.
Add to Postlyo
Paste the slot ID in the appropriate field in Settings → Ads.
Ads.txt
Ads.txt is a security feature that helps prevent ad fraud. It's a public file that declares who is authorized to sell your ad inventory.
Ads.txt Content
Automatically generated
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
Postlyo automatically generates your ads.txt file based on your Publisher ID. You can add additional entries if needed (e.g., for other ad networks).
Custom Ads.txt Entries
Optional additional lines
One entry per line. These are added to the auto-generated content.
Verify your ads.txt
yourblog.com/ads.txt. AdSense will show a warning if it's missing or misconfigured.Tracking Earnings
Want to see your ad revenue directly in Postlyo? You can enable AdSense tracking in the Analytics Dashboard Setup.
Settings → Ads controls whether ads appear on your blog.
Settings → Analytics Dashboard Setup lets you view earnings in your dashboard.
To track earnings in your dashboard:
Set up a service account
Follow the service account setup in the Analytics documentation.
Enable AdSense API
In Google Cloud Console, enable the "AdSense Management API".
Grant access
In AdSense → Settings → Access and authorization → User management, invite your service account email with Read-only access.
Configure in Postlyo
Go to Settings → Analytics Dashboard Setup and enter your AdSense Account ID (format: accounts/pub-XXXXXXXX).
AdSense Earnings Dashboard
What you'll see in Analytics
Earnings
$123.45
Page Views
12,345
Clicks
234
Page RPM
$10.00
Best Practices
📊 Don't overdo it
Too many ads hurts user experience and can actually reduce revenue. Start with Auto Ads and let Google optimize.
📱 Think mobile
Most traffic is mobile. Make sure ads don't overwhelm small screens. Auto Ads handles this automatically.
🚫 Never click your own ads
This violates AdSense policies and will get your account banned. Don't click ads on your own site, even accidentally.
📝 Focus on content first
More traffic = more ad revenue. The best monetization strategy is growing your audience with great content.
⚖️ Follow the policies
Read and follow AdSense program policies. Violations can result in account suspension or termination.
AdSense compliance is your responsibility