How AdSense and Auto Ads Decide Where Ads Go on Your Page
The problem
You paste one line of script into your site, flip a switch called Auto ads, and a day later there are ads in places you never chose: a bar stuck to the bottom of the screen, a box between two paragraphs, a full screen ad when someone clicks to the next page. Then the dashboard shows numbers called page RPM and impression RPM, and a payment that will only arrive once you cross a threshold.
None of that is magic, but almost none of it is explained in one place. This part follows the publisher side of Google's ad business: which product does what, what the AdSense tag does in the browser, how Auto ads picks positions, how buyers check that your inventory is really yours, and how the money is counted and shared.
One honest note before we start. Google documents the publisher settings well and the internals barely at all. So this post sticks to what Google's Help pages and the IAB Tech Lab specs say, plus a few things we actually fetched from this VM with curl. Where something is not documented, it is left out rather than guessed.
AdSense, Ad Manager and Ad Exchange are different jobs
Google sells three publisher products that get mixed up constantly. Google's own comparison page puts it like this:
| Product | What Google calls it | Who it is for, per Google |
|---|---|---|
| AdSense | An ad network | Publishers who want more automation and have a small ad management team. Websites only. |
| Google Ad Manager | An ad management platform | Large publishers with significant direct sales. Web and app. Supports multiple exchanges and networks, including AdSense, Ad Exchange and third parties. |
| AdMob | A mobile ad network and monetization platform | App developers. |
Ad Exchange, often called AdX, appears in Google's comparison as one of the demand sources Ad Manager supports, alongside AdSense and third party networks and exchanges. If you want the one line version: AdSense is Google selling your space for you, Ad Manager is your own ad server choosing between sources, and AdX is one marketplace that Ad Manager can call.
Two points from Google's comparison worth keeping. AdSense cannot run directly sold deals with your own advertisers or add other ad networks; Ad Manager can. And Google says all three products have access to the same premium Authorized Buyers, so "Ad Manager gets better ads" is not how Google describes the difference. The difference is control.
The rest of this post is about AdSense, because that is what most independent sites run. For the record, the only facts about BlogLLM used here: it runs AdSense with Auto ads on, and ads are hidden for Pro members.
What the AdSense tag does in your browser
Here is the manual ad unit code, as Google shows it in AdSense Help (with Google's placeholder IDs):
html<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567890123456" crossorigin="anonymous"></script> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-1234567890123456" data-ad-slot="1234567890"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
Three pieces, each with one job:
- The script tag loads
adsbygoogle.jsasynchronously, so it does not block the page. Theclientparameter carries your publisher ID. - The
inselement is the placeholder where the ad will appear.data-ad-clientis your publisher ID with aca-prefix.data-ad-slotis the ad unit ID. Google's AdSense for Platforms docs say the slot is optional for display units but required for other formats, and it is what makes the unit show up separately in your Ad units report. A responsive unit usesstyle="display:block"instead of a fixed width and height. - The
push({})line adds an entry to theadsbygooglequeue. The patternwindow.adsbygoogle || []means it works whether or not the script has finished loading yet: if it has not, the push sits in a plain array until the script picks it up.
With Auto ads you only need the first script tag on every page. Google then decides where to create slots.
What we could check from here
The script is real and not small. We fetched its headers and body from this VM on December 5, 2026:
text$ curl -sI https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js | grep -iE '^(HTTP/1.1 [0-9]+ OK|content-type|content-length|cache-control)' HTTP/1.1 200 OK Cache-Control: private, max-age=3600, stale-while-revalidate=3600 Content-Type: text/javascript; charset=ISO-8859-1 Content-Length: 205927 $ curl -s https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js | wc -c 204556
So about 200 KB of JavaScript, cacheable for an hour. The header size and the body size did not match, and an earlier request that morning reported a different Content-Length again, so Google seems to serve slightly different builds from request to request. The code is minified. We did not try to reverse engineer it, and this post makes no claims about what individual functions do.
From slot to rendered ad
After push({}), the script asks Google for an ad for that slot, Google runs its auction, and the winning ad is drawn into the space. Google does not publish the request format, so we will not pretend to.
What Google does document is the boundary around the ad. Two rules from Google's Help pages:
- AdSense policy says publishers must not manipulate ad targeting "using hidden keywords, IFRAMEs, or any other method". In other words, do not wrap the ad code in your own iframe.
- Ad Manager Help explains why: when an AdSense ad is served inside a nested iframe, browser security stops it from detecting the page URL or domain, so less relevant ads show and revenue drops.
You will also see SafeFrame mentioned in ad tech writing. Google's Ad Manager Help describes SafeFrame as a "managed API-enabled cross-origin iframe" that uses the browser's same-origin policy to stop the ad from reading or changing the page and from forcing redirects. It is turned on by default for the Google Publisher Tag, Ad Manager's tag, and since January 24, 2022 it always uses randomised subdomains. Google lists trade-offs too, including some added latency and limits on certain high-impact formats. We found no Google page saying the plain AdSense tag uses SafeFrame, so treat SafeFrame as an Ad Manager feature.

The ad unit types you can place yourself
If you place units by hand, AdSense offers these types, per its Help page on ad units:
| Unit | What Google says it is for |
|---|---|
| Display | Versatile ads that can show text, images or rich media and work almost anywhere. They resize to fit the layout and device, or can be set to fixed sizes. Also work with AMP pages. |
| In-feed | Ads that blend into feeds, such as lists of articles or products, styled to match the items around them. |
| In-article | Ads that sit between paragraphs and are styled to feel like part of the article. |
| Multiplex | A grid of content recommendation style native ads. |
| Search engine | A Google powered search box for your site, with ads shown next to the results. |
Display units are the default for a reason: they are responsive. Since August 2019, Google says, responsive units can resize their parent container, and they should not sit inside a container with a fixed or limited height.
Auto ads: what it places and how it decides
Auto ads is the alternative to hand placement. Google's description is short: you put one piece of code on all your pages, and Auto ads will "scan your site and automatically place ads where they're likely to perform well".
The formats, grouped the way Google groups them:
| Group | Format | What it does |
|---|---|---|
| In-page | Banner ads | Display or native ads placed inside your content |
| In-page | Multiplex | A grid of native ads |
| Overlay | Anchor ads | Stick to the top or bottom of the screen, mainly on mobile |
| Overlay | Vignette ads | Full screen ads shown between page loads, which the visitor can skip |
| Overlay | Side rails | Ads in the margins on wide screens |
| Intent-driven | Ad intents | Links and chips that Google adds based on the page |

How it chooses
Google says Auto ads works out the structure of each page, detects Google ads already on it, and places new ads based on the layout, the amount of content and the existing ads. It re-analyses when your site changes. That is the whole published explanation. There is no public list of rules like "one ad per N paragraphs".
What you get instead is a set of dials:
- Ad load. A setting for in-page ads that trades more ads for fewer. It is the closest thing to a density control.
- Existing ads. A toggle that lets Auto ads optimise around the units you placed by hand.
- Excluded areas. Parts of a page where Auto ads must not put in-page ads, such as a header or a sign up box.
- Page exclusions. Whole pages, or groups of pages, where Auto ads does not run at all.
- Per format settings. For anchors, position (top, bottom, or either) and whether they show on screens wider than 1000px. For side rails, left or right. For vignettes, how often they show and whether they show on wide screens.
- Experiments. "Run experiment first" tries a change on 50% of your traffic for up to 90 days before you commit.
Google also says changes can take up to an hour to show on your site, which matters when you are testing and see nothing.
flowchart TD A[Auto ads code on every page] ==> B[Google analyses page structure and content] B ==> C{Excluded page?} C ==>|yes| Z[No Auto ads on this page] C ==>|no| D[Find possible positions] D ==> E[Drop excluded areas and positions near existing ads] E ==> F[Apply ad load and per format settings] F ==> G[Request ads for chosen positions]
The flowchart is a summary of Google's published settings, not of Google's code. The order of the inner steps is our reading of the docs.
ads.txt: proving the inventory is yours
The ad tag says "this is publisher X". Nothing stops a fraudster from putting publisher X's name in a fake bid request for a site they do not own. ads.txt is the fix, and it borrows the idea of robots.txt: you post a plain text file at the root of your domain listing who may sell your ads. Because only the site owner can put a file there, the file itself is the proof.
The IAB Tech Lab spec (version 1.1, final release July 2022) defines each line as up to four comma separated fields:
| Field | Name | Meaning |
|---|---|---|
| 1 | Domain of the advertising system | The exchange or network that buyers connect to |
| 2 | Publisher's account ID | Your ID in that system, the same value it puts in bid requests |
| 3 | Relationship | DIRECT if you control the account, RESELLER if you authorised someone else to sell through it |
| 4 | Certification authority ID | Optional. An ID for the advertising system with a certification body, currently TAG |
Here is BlogLLM's real file, fetched from this VM:
text$ curl -s https://blogllm.com/ads.txt google.com, pub-9304731671950770, DIRECT, f08c47fec0942fa0
Reading it left to right: Google is the advertising system, pub-9304731671950770 is the AdSense publisher ID (the ca- prefix from the ad tag is dropped), the relationship is DIRECT, and f08c47fec0942fa0 is Google's certification ID. That last value is the same in every AdSense ads.txt line; Google's own ads.txt guide uses it in its template, and Google's sellers.json lists it as its TAG-ID (shown below).
A few rules from the spec that trip people up:
- The file must be served with
Content-Type: text/plain. Other content types should be treated as an error. (BlogLLM's response header isContent-Type: text/plain; we checked.) - If a crawler gets a 404, it can assume there are no declarations. Publishers who want to say "nobody is authorised" should use the spec's placeholder line, not an empty file.
- Crawlers should cache the file, and with no cache headers the default expiry is 7 days. Google's own help adds that changes can take a few days to show in AdSense, and up to a month for sites with few ad requests.
- Version 1.1 added two variables,
OWNERDOMAINandMANAGERDOMAIN, for naming the business that owns the site and an exclusive monetisation partner.
sellers.json: the other half
ads.txt is the publisher saying who may sell. sellers.json is the exchange saying who its sellers are. The IAB spec has each advertising system host the file at its own domain and list every seller ID, with the same ID that appears in ads.txt, plus a seller_type of PUBLISHER, INTERMEDIARY or BOTH. The spec says a seller ID must not stand for more than one entity.
Google's file is linked from its help pages. We downloaded it and summarised it with a small script (sellers_json_stats.py, saved with this series' code):
text$ curl -sL https://realtimebidding.google.com/sellers.json -o sellers.json $ python3 sellers_json_stats.py version: 1.0 identifiers: [{'name': 'TAG-ID', 'value': 'f08c47fec0942fa0'}] sellers listed: 961010 by seller_type: {'PUBLISHER': 960419, 'BOTH': 591} marked is_confidential: 681712 fields used: ['domain', 'is_confidential', 'name', 'seller_id', 'seller_type']
The download was about 107 MB, and the request redirected to a file on Google Cloud Storage. The top of the file also carries a note that it is a beta and unverified. These counts are a snapshot from December 5, 2026 and will change.
flowchart LR R[Bid request: site blogllm.com, seller google.com pub ID] ==> B[Buyer] B ==> A[Fetch blogllm.com/ads.txt] B ==> S[Fetch Google sellers.json] A ==> C{Is google.com plus this pub ID listed?} S ==> D{Does this pub ID exist, and what type?} C ==> V[Authorised path: bid] D ==> V
How the money is counted
Revenue share
Google's current AdSense Help page gives one clean rule: for AdSense for Content, "publishers receive 80% of the revenue, after the advertiser platform takes its fee". When the advertiser buys through Google Ads, Google says publishers keep "about 68%". AdSense pays publishers an effective eCPM for advertiser bids, meaning per impression. Google adds that it does not disclose revenue share for all AdSense products.
That 68% is old. In a 2010 post on the Inside AdSense blog, Google said AdSense for Content publishers earned 68% of what advertisers paid, unchanged since 2003, and AdSense for Search publishers 51%, unchanged since 2005. A later Google blog post explained the newer split: Google Ads keeps an average of 15% on the buy side, and AdSense takes 20% of what is left, which multiplies back to about 68%.
For Ad Manager, Google published a different kind of number in June 2020: when advertisers used Google Ads or Display & Video 360 to buy display ads through Ad Manager in 2019, publishers kept over 69% of the revenue. That is a measured outcome for 2019, not a fixed rate.
Payment thresholds
AdSense pays once your balance reaches a threshold, which depends on your reporting currency. Some values from Google's table:
| Currency | Payment method selection | Payment |
|---|---|---|
| US dollar | $10 | $100 |
| Euro | €10 | €70 |
| British pound | £10 | £60 |
The same table sets identity verification at $0 and address verification at $10 (or local equivalent), so you verify before ads show and again early on.
The RPMs
RPM is revenue per thousand, and AdSense uses the same formula with different denominators:
| Metric | Formula, per AdSense Help |
|---|---|
| Page RPM | (Estimated earnings ÷ page views) × 1000 |
| Impression RPM | (Estimated earnings ÷ impressions) × 1000 |
| Ad request RPM (in the Management API) | (Estimated earnings ÷ ad requests) × 1000 |
Google's own examples: $0.15 from 25 page views is a page RPM of $6.00, and $180 from 45,000 ad impressions is an RPM of $4.00. Google also warns that RPM does not represent what you actually earned; it is a rate. For counting impressions, the AdSense Management API says an impression is counted for each ad request where at least one ad has been downloaded to the user's device and has begun to load.
The practical point: the two can move in opposite directions. More ads per page means more impressions per page view, so page RPM can rise while impression RPM falls. Watch both. Part 8 goes into that trade off.
Invalid traffic: the rule that can end an account
Google defines invalid traffic as "any clicks or impressions that may artificially inflate an advertiser's costs or a publisher's earnings". That covers deliberate fraud and accidents alike. Google's examples include clicking your own ads, repeated clicks or impressions from one source, encouraging people to click, and automated tools or robots.
The consequences Google lists: ad serving can be limited, or the account suspended or closed. Google also notes that the earnings you see as estimated can differ from what is finalised, and invalid activity is one reason.
For a small site the risk is usually not fraud, it is placement. Ads that sit where people tap by mistake create accidental clicks, which Google counts as invalid too. That is one more reason the Auto ads dials above exist.
What's next
AdSense hides the auction from you: you paste a tag and Google picks the winner. Part 4 opens that box. It follows a single slot through real-time bidding: the bid request, OpenRTB, header bidding, and how many buyers can compete for one ad in the time it takes a page to load.
Sources
- Google Ad Manager, AdSense, and AdMob, AdSense Help
- Where to place ad unit code, AdSense Help
- Ad tags, AdSense for Platforms, Google for Developers
- Improvements to responsive ad units, AdSense Help
- Modifications of AdSense ad code, AdSense Help
- AdSense line items, Ad Manager Help
- SafeFrame, Ad Manager Help (17101123)
- SafeFrame, Ad Manager Help (6023110)
- About ad units, AdSense Help
- About Auto ads, AdSense Help
- Set up Auto ads, AdSense Help
- Auto ads settings, AdSense Help
- ads.txt version 1.1, IAB Tech Lab
- sellers.json version 1.0, IAB Tech Lab
- Ads.txt guide, AdSense Help
- Ads.txt for platforms, AdSense for Platforms
- Google's sellers.json location, AdMob Help
- AdSense revenue share, AdSense Help
- Evolving how publishers monetize with AdSense, Google blog
- Inside AdSense blog, May 2010 archive (revenue share post)
- How display buying platforms share revenue with publishers, Google blog, June 2020
- Payment thresholds, AdSense Help
- Revenue per thousand impressions (RPM), AdSense Help
- Page RPM, AdSense Help
- Impression RPM, AdSense Help
- Metric reference, AdSense Management API
- Invalid traffic, AdSense Help
