Google Ad Manager and AdSense: How to do the right setup to increase revenue?
In this article, we’ll look at how to best set up your Google Ad Manager and Google AdSense account to maximize your revenue. We’ll migrate your existing ads and ad units to Ad Manager and set them up as backups.
Now we will migrate everything except Auto Ads from AdSense. If you haven’t already enabled Auto Ads, you should understand why you should enable them. An ideal setup would be Auto Ads + Ad Manager units.
Along with this, we will also discuss one of the most common mistakes publishers make during AdSense/Ad Manager setup. Read it till the end to avoid these mistakes.
What are Auto Ads, and why do they increase your revenue the most?
According to Google, Auto Ads is a simple and innovative way to monetize your content. All you have to do is insert a single code into your page, and Auto Ads will scan your site and automatically place ads where they’re likely to perform best.
why do we need Auto Ads?
Auto Ads gives us two specific formats that perform best:
- Sticky Ads: These stick to the top of the site. (You may have seen these on many sites).
- Vignette/Interstitial Ads: These are full-screen ads that appear during page load or transition.
Both these types of ads help to increase your revenue significantly.
What is the correct way to enable Auto Ads and apply the code?
To enable Auto Ads, go to Ads, Overview in the AdSense UI and select your site.
- Click on Edit button.
- Turn on Enable Auto Ads.
- You can choose which formats you want—for example: You can disable Vignette Ads if you’re very concerned about the user experience on your site, as they can be a bit user intrusive.
- Click Apply changes to the site.
- You can run Experiment if you want, but based on experience, it is recommended to click Apply Now directly as Auto Ads usually perform best in terms of revenue.
Applying the code:
Even though we have enabled Auto Ads from the UI, we need to implement this code in our site to make it work.
- Go to Get Code section from AdSense UI and copy the code snippet.
- Apply this AdSense code inside the <head> section in the header.php file of the WordPress site.
- Note that only the Head section has code for Auto Ads, and it dynamically inserts the Body section ads by itself.
Pro tip: Manually editing the code in the theme editor is not an ideal method.
Developers usually edit the files using a code editor like Visual Studio Code so that the work is done correctly.
How to find out whether you have installed AdSense Auto Ads code on your site correctly or not?

To make sure you’ve implemented the code correctly, you can find your Publisher ID by going to your site’s source code. If you see the AdSense code inside the head section, it means you have applied it correctly.
What is the biggest mistake of AdSense/Ad Manager setup that the publisher should avoid?
Making sure your AdSense Auto Ads show up properly is important to your revenue. For this you need to implement the ads.txt file.
What is ads.txt?
ads.txt (Authorized Digital Sellers) is an IAB (Interactive Advertising Bureau) initiative that gives publishers the right to authorize who can buy their inventory.
If you don’t implement ads.txt file, can your revenue decrease?
Yes, of course! In your ads.txt file, you authorize the ad network to sell your inventory. If you don’t authorize them, they won’t be able to buy ads on your site.
After implementing ads.txt, if you don’t, your inventory won’t sell and your revenue will definitely suffer.
Google Ad Manager and AdSense: How to set up correctly to increase revenue?
- What are Auto Ads, and why do they increase your revenue the most?
- What is the correct way to enable Auto Ads and apply the code?
- How to find out whether you have installed the AdSense Auto Ads code on your site correctly or not?
- What is the biggest mistake of AdSense/Ad Manager setup that the publisher should avoid?
- If you don’t implement ads.txt file, can your revenue decrease?
What 4 important things are included in the ads.txt file and how to implement it on the site?
An ads.txt file will contain several entries, each of which authorizes a specific ad network to buy your inventory.
An entry has four columns:
- Ad Network Name (Network Name): eg google.com (for Google AdSense).
- Publisher ID: This uniquely identifies your AdSense account. You can easily get it from your AdSense UI URL.
Relationship Type:
- DIRECT: This means that you directly own this AdSense account.
- RESELLER: This means you are selling through another small ad network (eg Monumetric, Ezoic).
- Certification Authority ID (Certification Authority ID): This is an ID related to the Ad Network.
Implementing ads.txt:
- The ads.txt file should be hosted at the root of your domain (for example: yourdomain.com/ads.txt).
- Instead of manually uploading the file to the root directory, an easy way to implement this in WordPress is to use a plugin.
- Install and activate the Advanced Ads plugin (which has about a million active installations).
- Go to settings and go to ads.txt option.
- Paste your entry and replace it with your Publisher ID.
- Save the settings.
- Now if you go to /ads.txt on your site, you will see your entry.
Why Google Ad Manager units are important, and how to generate code for multiple units?
As we mentioned in the beginning, our setup will be Auto Ads and Ad Manager units from AdSense.
Ad Manager units are important because they give you complete control over which ads you want to display. Through these you can also run Direct Ads, which are the highest paying ads. If direct ads don’t fill the inventory, we can set up other networks like AdSense as backfill.
Creating Ad Units:
Suppose we need the following:
- 1 x 728×90 (leaderboard – above home section).
- 2 x 300×250 (medium rectangle – between paragraphs and in sidebar).
Going to the Ad Manager UI, we will create new ad units (like leaderboard_1) as per our requirement.
Generating code for multiple ad units:
- We will generate code for multiple ad units in a simplified manner using the Ad Manager Tag Generator and Tester tool.
- Enter your Ad Manager Ad Network ID (which is in the URL) into the tool.
- Enter the code names and sizes of all your required add units (such as leaderboard_1 and medium_rectangle).
Note: You can use the same code name (medium_rectangle) for two different ad slots (Paragraph and Sidebar). Doing so will create a single add unit, two add slots.
Advanced Options:
Center Ads: It helps to center the ads automatically.
Collapse Empty Divs: This is a feature that hides empty slots when no add is available. However, it is recommended to keep it disabled for now to avoid CLS (Cumulative Layout Shift) problems, as the sudden disappearance of free space can cause layout shifts, which is not good for Google Web Vitals.
Generating tags:
On clicking Generate Tags, you will get the Header Code and Body Code, which will contain all your ad units.
How to make sure whether ads are showing in multiple ad slots or not?
When you first apply the code, you need to make sure in the delivery section that Ad Manager is delivering ads for all slots.
For testing:
- Instead of enabling AdSense as a backfill, we will use Direct Ads to ensure that ads are showing.
- Go to the Delivery section.
- If you created two slots using the same add unit (medium_rectangle), you must duplicate the line item targeting that add unit.
Important: Some people believe that Google Ad Manager will reuse the same ad for multiple ad slots, but this is not the case. Each ad slot requires a separate line item to deliver a different ad. Duplicating the line item will ensure that the add will appear in the other slot as well.
How to ensure whether ads will appear in multiple ad slots of the same size or not?
In the previous discussion, we duplicated the Ad Manager Line Item to ensure that the second ad slot (medium rectangle) is also filled with ads.
You must always ensure that if you have five ad slots of size 300×250, then your Line Item contains at least five copies of the ads, otherwise the ads will not appear in all those slots simultaneously.
Adding a leaderboard ad (728×90) to a line item:
- Add 728×90 size to your Line Item.
- Target leaderboard_1 ad unit.
- Go to the Creative section, upload a 728×90 size image creative (like KFC’s ad).
Important: If the actual size of the creative is not 728×90, you need to resize it on your computer first so that there are no problems in Ad Manager.
Note: After setting the Line Item, it may take 5 to 10 minutes for the ads to appear.
Which 3 methods should be used to apply the ad code at different positions?
We will use Advanced Ads Plugin, Theme Files and Widgets to implement Ad Codes (Header Code and Body Codes) on our site so that you know every way.
1. Using the Advanced Ads Plugin:
a. Applying Header Code (Head Section):
- Go to Placements and create a new placement, name it Head Code.
- Create a new ad by going to the Ads section, paste the Header Code of Ad Manager into it.
- Assign this ad to Head Code placement.
b. Applying an In-Content Ad (in the middle of a post):
- Go to Placements and create a new placement (eg: 300×250 In-Content).
- Select the option “Inside the Content” and decide after which paragraph you want the add (for example: After the first paragraph).
- Go to Ads section, enter Ad Manager Body Code for 300×250 In-Content.
- Assign it to the new In-Content placement.
2. Use of Theme Files:
Applying the Header Add (728×90):
Since there is no default placement for this specific location (below Header/Logo) in the Advanced Ads plugin, we will use the theme file:
- Open the header.php file in your code editor (Visual Studio Code).
- Identify the location where you want the ad (usually after the logo and navigation menu code).
- Paste the 728×90 Body Code there.
Adding styling (spacing):
To give the ad the correct spacing, you need to use CSS:
- Add a class to the ad’s <div> tag in header.php (example: <div class=”ad-styles”>).
- Go to the styles.css file and write the CSS code for this class (example: .ad-styles { margin-top: 20px; }).
3. Use of Widgets:
Applying the Sidebar Ad (300×250):
The easiest way to add an ad to the sidebar is to use WordPress Widgets:
- Go to Appearance > Widgets in the WordPress backend.
- Drag a Custom HTML widget to the Sidebar widget area.
- Paste the Body Code of Ad Manager for 300×250 ad slot in it (this will be the third ad slot).
- Save.
Why is the big ad cut of 728×90 on mobile, and what is the solution?
After completing your setup, you may notice that the 728×90 leaderboard ad is getting cut (cropped) in the mobile view. This is a common problem because a large ad designed for desktop cannot fit on a small mobile screen. The solution is Size Mapping
Size Mapping is a technique used by Google Ad Manager to determine which ad size should be displayed based on the user’s screen size (viewport size).
Why is the big ad cut of 728×90 on mobile, and what is the solution?
In the previous discussion, we saw that a large 728×90 leaderboard ad designed for desktop is getting cut (cropped) on mobile. The most effective solution is Size Mapping.
What is size mapping, and how does it change ad sizes for mobile?
Size Mapping is an advanced Ad Manager feature that allows us to display different ad sizes for different viewport sizes (screen sizes).
This tells the add code that:
- If the device width (viewport width) is greater than a certain breakpoint (eg 900 pixels), then show a larger size ad like 728×90.
- Otherwise (eg on mobile), show a smaller ad size like 300×250 or 320×50.
How to apply:
- Go to Ad Manager Tag Generator and Tester tool.
- Click on Size Mapping option.
- Set a breakpoint (eg: Viewport 900×0).
- Set mapping (eg: 728×90 above 900 pixels, 300×250 at 0 pixels).
- Copy the updated Header Code.
Why does “Display Call” error occur after applying size mapping, and how to fix it immediately?
When you generate new code with the tag generator, new IDs are created in the Header Code.
If you only change the Header Code in the Advanced Ads plugin, you will see an error (Google defined slot was called without a matching display call) in the Google Publisher Console. This happens because the head section has new IDs, but the body section is using the old IDs.
Troubleshooting and Solutions:
- Open the Google Publisher Console (by adding ?googfc to the site URL).
- Identify the error.
- Copy the new body code generated from the tag generator.
- Replace the code in all three body slots of your site:
- 300×250 In-Content: In Advanced Ads.
- 300×250 Sidebar: In Widgets > Custom HTML.
- 728×90 Leaderboard: header.php in theme file.
After changing all the code, check the Google Publisher Console to make sure there are no more errors and the 300×250 ad is showing in mobile view.
Does size mapping make your ad ‘fully’ responsive?
No, Size Mapping only switches ad sizes for different viewport sizes (eg desktop to mobile). It is not fully responsive.
If you want the add to fluidly scale when you resize the browser, you need to use Fluid Size and create a native template. This is an advanced approach that will be covered in a future video.
What is the correct way to set adsense as ‘backfill’ to maximize revenue?
When you don’t have Direct Advertisers (which is common for smaller publishers), you need to make sure that slots are not left empty if there are no Direct Ads available. For this it is necessary to set AdSense as Backfill.
The wrong way: Creating a separate Price Priority Line Item in Ad Manager by copying the code from AdSense.
Problem: If AdSense doesn’t have an ad (even though it has a high fill rate), this Line Item will show an empty ad. This will prevent other networks (like House Ads/KFC Ad) from appearing in Ad Manager.
The right and revenue-maximizing method:
- Go to Ad Units section in Ad Manager.
- Check the option “Maximize the revenue of the unsold inventory by AdSense” there.
Advantage: Checking this will automatically configure AdSense ads as backfill. AdSense will only display an ad if it has an ad. If AdSense doesn’t have an ad, control returns to Ad Manager, giving you the opportunity to show House Ads or another network. This reduces your chances of an empty slot.
Which two advanced monetization techniques can increase your revenue by 3-4 times in future?
To take monetization to the next level, you should focus on the following two techniques:
- Header Bidding: This is a great way to connect with big bidders like Amazon. It works like AdSense backfill, only shows ads when they’re available, and returns control to Ad Manager.
- Outstream Ads: Setting up Outstream Ads using a network like Premise. The CPM (cost per thousand impressions) of these ads can be 3 to 4 times higher than normal display ads.
