Sub topic 10
Pop-ups on Mobile and Search Guidelines
This chapter assumes you can build the <dialog> pop-up and the scroll trigger from the earlier chapters. It also assumes you know basic CSS media queries and how a search result click lands on a page. It covers three things: why pop-ups behave differently on phones, what Google's guidance on intrusive interstitials says, and how to adapt your pop-up so it keeps converting without hurting visibility or usability.
Why mobile changes the rules
A pop-up that is a minor nuisance on a 1440-pixel-wide monitor can cover the whole page on a 390-pixel-wide phone. Four differences matter.
- Screen space. A centered 500-pixel modal covers most of a phone viewport. Content behind it is effectively unreachable.
- No pointer. Touch screens have no hover and no cursor. The "exit intent" trigger, which fires when the mouse moves toward the browser's top edge, cannot work on a phone.
- Small targets. A close button sized for a mouse is hard to hit with a thumb. A missed tap on a tiny "x" often lands on the form or the page underneath.
- The on-screen keyboard. When the visitor taps the email field, the keyboard can cover half the viewport. If the dialog is taller than what remains, the submit button disappears.
Mobile traffic is usually the largest share of visits, so these problems affect most of your visitors.
What search guidelines say
Google has a long-standing guideline about intrusive interstitials. An interstitial is any element that sits between the visitor and the content they came for. Google's guidance says pages where content is not easily accessible to a visitor arriving from search results may rank lower.
Google names three patterns that cause problems:
- A pop-up that covers the main content right after the visitor arrives from search results, or while they read.
- A standalone interstitial that must be dismissed before the main content can be seen.
- A layout where the above-the-fold part looks like a standalone interstitial, but the real content has been pushed below the fold.
Google also lists cases that are not a problem:
- Interstitials required by law, such as cookie-consent notices or age verification.
- Login dialogs on pages with private content, such as email or paywalled material.
- Banners that use a reasonable amount of screen space and are easy to dismiss, such as an app install banner.
Treat this as a ranking signal among many, not a penalty switch. The rules are not published as exact pixel thresholds, so you cannot test for compliance automatically. Design conservatively and check your own pages.
The guideline concerns the moment of arrival, which makes this the most important design decision in the chapter. A pop-up that appears after the visitor has read half the article is a different thing from one that appears the instant the page loads from a search click.
Choosing a mobile format
Not every placement type survives on a phone. Compare them by how much of the content stays visible and usable.
| Format | Screen space used | Mobile risk | Recommendation |
|---|---|---|---|
| Full-screen overlay | 100% | High. Matches the intrusive pattern. | Avoid for search visitors. |
| Centered modal | 50-80% | Medium to high. Keyboard problems. | Use only after engagement. |
| Bottom sheet (dialog pinned to the bottom edge) | 30-50% | Low to medium. Thumb-friendly. | Good default for pop-ups. |
| Sticky bar (top or bottom) | 5-15% | Low. Content stays readable. | Good for first visits. |
| Inline form in the content | Part of the page flow | Lowest. Not an interstitial. | Always include one. |
A common approach is to use an inline form and a sticky bar for first-time search visitors. Reserve the bottom sheet for visitors who show interest by reading further or returning.
Building a mobile-friendly pop-up
You can reuse the <dialog id="signup-dialog"> markup from the earlier chapter. Add CSS that turns it into a bottom sheet on small screens and sizes the controls for touch:
#signup-dialog {
width: min(32rem, calc(100% - 2rem));
max-height: 85dvh;
overflow: auto;
border: 0;
border-radius: 12px;
padding: 1.25rem;
}
#signup-dialog input,
#signup-dialog button {
min-height: 44px;
font-size: 1rem;
}
@media (max-width: 767px) {
#signup-dialog {
width: 100%;
max-width: 100%;
margin: auto 0 0;
border-radius: 12px 12px 0 0;
padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
}
}Each rule solves a specific problem:
max-height: 85dvhwithoverflow: autokeeps the dialog inside the visible viewport. Thedvhunit tracks the viewport as browser toolbars show and hide, so the submit button stays reachable. If the keyboard still covers part of the dialog, the visitor can scroll inside it.min-height: 44pxgives touch targets the commonly recommended size of about 44 CSS pixels. Your "No thanks" button needs this too.font-size: 1rem(16 pixels) stops iOS Safari from zooming in when an input gets focus. Smaller text triggers that zoom, and the visitor then has to pinch back out.margin: auto 0 0pins the modal dialog to the bottom edge, where thumbs rest.env(safe-area-inset-bottom)adds padding on phones with a home-indicator bar. It only takes effect if your page's viewport meta tag includesviewport-fit=cover. Without it the value is 0, which is harmless.
Keep the "No thanks" button as visible as the submit button. Hiding or shrinking the dismiss control is a dark pattern, and it also pushes the pop-up toward the intrusive category.
Triggers that work on touch screens
Without a cursor, you have three reliable signals on mobile:
- Scroll depth. The visitor has moved through a share of the page.
- Time on page. The visitor has stayed for a minimum number of seconds.
- Return visits. The visitor has viewed more than one page in a session, or has come back.
Combine them. Scroll depth alone can fire after a fast flick to the bottom. A timer alone can fire on a page the visitor has not read. Requiring both, and skipping the first page view of a search visit, fits the guidance.
const KEY = 'signupDismissedAt';
const COOLDOWN_MS = 7 * 24 * 60 * 60 * 1000;
const MIN_TIME_MS = 15000;
const dialog = document.querySelector('#signup-dialog');
const startedAt = Date.now();
const isMobile = window.matchMedia('(max-width: 767px), (pointer: coarse)').matches;
const scrollTarget = isMobile ? 0.6 : 0.5;
function cameFromSearch() {
if (!document.referrer) return false;
try {
const host = new URL(document.referrer).hostname;
return /(^|\.)(google|bing|duckduckgo|yahoo)\./.test(host);
} catch {
return false;
}
}
function recentlyDismissed() {
const t = Number(localStorage.getItem(KEY));
return t > 0 && Date.now() - t < COOLDOWN_MS;
}
const views = Number(sessionStorage.getItem('views') || 0) + 1;
sessionStorage.setItem('views', String(views));
const firstSearchView = views === 1 && cameFromSearch();
function onScroll() {
if (Date.now() - startedAt < MIN_TIME_MS) return;
const scrollable = document.documentElement.scrollHeight - window.innerHeight;
if (scrollable > 0 && window.scrollY / scrollable >= scrollTarget) {
window.removeEventListener('scroll', onScroll);
if (!dialog.open) dialog.showModal();
}
}
if (!recentlyDismissed() && !firstSearchView) {
window.addEventListener('scroll', onScroll, { passive: true });
}
dialog.addEventListener('close', () => {
localStorage.setItem(KEY, String(Date.now()));
});This script does four things on top of the earlier version. It raises the scroll threshold on touch devices. It requires 15 seconds on the page. It suppresses the pop-up on the first page view of a visit that came from a search engine. It also checks dialog.open so a second showModal() call cannot throw an error if another script opened the dialog first.
Two limits apply. document.referrer can be empty because of privacy settings or Referrer-Policy headers, so cameFromSearch() will miss some search visitors. In that case the pop-up still waits for 15 seconds and 60% scroll, which is a reasonable fallback. Also, sessionStorage is cleared when the tab closes, so "first view" means first in this tab.
The decision as a flow
The diagram summarizes the order of checks before any prompt appears.
Common errors
- Testing only on desktop. Browser device emulation does not reproduce the on-screen keyboard or real toolbar behavior. Check the pop-up on at least one real iPhone and one real Android phone.
- Hijacking the back button. Some scripts push a history entry so that tapping Back opens a pop-up. This breaks navigation, frustrates visitors, and is the kind of behavior browsers and search engines move against.
- A page that shifts when the prompt loads. Inserting a bar into the page flow pushes content down and hurts Core Web Vitals, the performance measures Google reports for page experience, through layout shift. Use
position: fixedfor bars, or reserve their space in the layout. - Loading the pop-up script before the content. Heavy third-party scripts delay the largest content element. Load them after the page is interactive.
- Treating legal notices as sign-up prompts. A cookie banner is an allowed interstitial. A newsletter pop-up stacked on top of it is not covered by that allowance. Show only one prompt at a time, with the legal notice first.
Verifying your setup
After making these changes, check them in order:
- Open a page from a search result link on a phone, or paste the URL with a search-engine referrer into a test harness. The pop-up must not appear on the first view.
- Scroll quickly to the bottom within 15 seconds. Nothing should open yet.
- Wait, then scroll. The bottom sheet should appear and the submit button should stay visible when the keyboard opens.
- Close it, reload, and confirm it stays hidden for seven days.
- Compare sign-up rate and organic search traffic before and after. A rising sign-up rate with falling search clicks would suggest the change is costing you more than it earns.
Exercise
A news site sends 70% of its traffic from search, and most visitors read one article and leave. The team wants a full-screen newsletter pop-up that appears 3 seconds after the page loads. Name two problems with this plan and propose a replacement that still collects sign-ups.
Show answer
First, a full-screen overlay shortly after arrival from search matches Google's intrusive interstitial pattern and could reduce ranking. Second, most visitors read only one article, so a 3-second timer fires before they have shown any interest and trains them to dismiss it. A better plan is an inline form at the end of each article plus a small sticky bar, and a bottom-sheet pop-up only after 15 seconds and 60% scroll, or on a later page view in the same session, with a 7-day cooldown after dismissal.
Exercise
Why does an exit-intent trigger fail on a phone, and which two signals can replace it?
Show answer
Exit intent depends on detecting the mouse moving toward the browser's edge, and a touch screen has no cursor, so the event never fires. Scroll depth and time on page (or a return visit in the same session) can replace it, and they work best combined.