Many websites and ad networks still rely on page views or hits to measure ad impressions, but these numbers don’t accurately reflect how many actual humans see an ad. Here’s why:
1. Page Views vs. Ad Impressions
- A page view happens when a browser loads a webpage. But just because a page loads doesn’t mean a person actually looks at the ad.
- An ad impression should ideally count when an ad is actually displayed in a visible area on a user’s screen.
2. Common Issues That Inflate Impression Counts
- Bots & Crawlers: Search engines and automated bots visit websites all the time, generating fake page views.
- Multiple Ads Per Page: If a page has 10 ads, some systems count all 10 as “impressions,” even if they load off-screen where the user never sees them.
- Fast Page Switching: Some users might quickly navigate through pages without actually looking at the content or ads.
- Background Page Loads: Some websites refresh content in the background, loading ads without a user actively browsing.
3. Better Ways to Measure Real Views
- Viewability Tracking: Some ad platforms use technology to ensure an ad was actually visible for a certain amount of time before counting it.
- Engagement Metrics: Clicks, scroll tracking, and mouse movement data can help determine if a real user actually saw an ad.
- Unique Users Instead of Page Views: Counting unique visitors instead of just hits gives a better sense of how many real people saw the ad.
4. Why Some Sites Overbill Anyway
- Some sites (intentionally or not) still charge advertisers based on raw page views because it inflates the numbers.
- Less ethical publishers may include bot traffic to boost reported impressions.
- Some advertisers simply don’t scrutinize the data closely enough.
Takeaway
If you’re paying for ad impressions, you should demand transparency from the site or network. Look for metrics that measure actual viewability, engagement, or unique human users instead of just raw page views.
Here’s how you can improve accuracy:
1. Log Only Visible Ad Impressions
Instead of counting every time a page loads, track when an ad actually appears on the user’s screen.
How to Do This:
- Use JavaScript to detect when an ad enters the user’s viewport (i.e., becomes visible).
- Only then log an impression to your file.
Example using JavaScript:
document.addEventListener("DOMContentLoaded", function () {
const ad = document.getElementById("ad-banner"); // Select your ad element
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
fetch("/track_ad.php?ad_id=12345"); // Send log request when visible
observer.unobserve(ad); // Stop tracking after first view
}
});
}, { threshold: 0.5 }); // Triggers only if 50% of ad is visible
observer.observe(ad);
});
✅ This ensures the ad is at least 50% visible before logging it.
2. Filter Out Bots & Crawlers
Most bots don’t run JavaScript, so using a JavaScript-based tracking method helps.
But to be extra sure:
- Check the User-Agent of the visitor and filter out known bots.
- Look at behavior—bots often request many pages very quickly.
You can add bot filtering in PHP when logging:
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$botKeywords = ["bot", "crawl", "spider", "fetch", "google", "yahoo", "bing"];
$isBot = false;
foreach ($botKeywords as $bot) {
if (stripos($userAgent, $bot) !== false) {
$isBot = true;
break;
}
}
if (!$isBot) {
file_put_contents("ad_logs.txt", "Ad 12345 viewed by " . $_SERVER['REMOTE_ADDR'] . "\n", FILE_APPEND);
}
✅ This prevents fake views from search engine crawlers and spam bots.
3. Track Unique Users Instead of Just Hits
If the same user reloads the page 10 times, that shouldn’t count as 10 separate ad views.
You can track unique views per session using cookies:
session_start();
$adId = 12345;
if (!isset($_SESSION["ad_seen_$adId"])) {
file_put_contents("ad_logs.txt", "Ad $adId viewed by " . $_SERVER['REMOTE_ADDR'] . "\n", FILE_APPEND);
$_SESSION["ad_seen_$adId"] = true; // Prevent duplicate counting
}
✅ This stops inflated counts from refreshes.
4. Log Clicks Separately from Views
You already track clicks, but make sure it’s separate from impressions:
if (isset($_GET['ad_id'])) {
file_put_contents("click_logs.txt", "Ad " . $_GET['ad_id'] . " clicked by " . $_SERVER['REMOTE_ADDR'] . "\n", FILE_APPEND);
header("Location: https://advertiser-site.com"); // Redirect to ad link
}
✅ This ensures click tracking stays independent from views.
5. Analyze Logs for Accuracy
- Look for spikes in views from the same IP. If one IP logs hundreds of views in minutes, it’s likely automated.
- Use user-agent filtering to block traffic from known bots.
- Compare impressions to clicks. If an ad gets 10,000 views but only 2 clicks, you may have fake traffic.
Final Thoughts
By using JavaScript for viewability tracking, bot filtering, and session-based unique views, you’ll ensure only real human users seeing the ad count as an impression.