Skip to main content

Ads & Monetization

Monetize your blog with Google AdSense. Display ads on your content and track earnings directly in your dashboard.

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

Display Ads (Settings → Ads) – controls where ads appear.
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

Google reviews applications manually. It can take days to weeks for approval. Make sure your blog has quality content and meets their policies before applying.

Finding Your Publisher ID

1

Log in to AdSense

Go to google.com/adsense and sign in.

2

Open Account Settings

Click Settings → Account → Account information.

3

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

We recommend starting with Auto Ads enabled. Google optimizes placements for both revenue and user experience. You can always switch to manual later.

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

1

Go to AdSense

Open your AdSense account.

2

Create an ad unit

Go to Ads → By ad unit → Display ads → Create.

3

Configure the unit

Give it a name (e.g., "Blog Header") and choose responsive size.

4

Get the slot ID

After creating, you'll see code. Find the data-ad-slot value – that's your slot ID.

5

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

Your ads.txt file is available at 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.

This is separate from displaying ads

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:

1

Set up a service account

Follow the service account setup in the Analytics documentation.

2

Enable AdSense API

In Google Cloud Console, enable the "AdSense Management API".

3

Grant access

In AdSense → Settings → Access and authorization → User management, invite your service account email with Read-only access.

4

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

Displaying ads means agreeing to Google's policies. Make sure your content is family-friendly, original, and doesn't violate any guidelines.