Official statement
Other statements from this video 12 ▾
- 0:32 Le service de rendu Google bloque-t-il vos ressources cross-origin à cause de CORS ?
- 1:03 Les données dupliquées dans vos balises script pénalisent-elles vraiment votre SEO ?
- 1:03 La lazy hydration peut-elle vraiment tuer votre crawl budget ?
- 2:08 Pourquoi Google ne peut-il pas partager le cache JavaScript entre vos domaines ?
- 2:41 Google sur-cache-t-il vraiment les ressources de votre site ?
- 4:14 Le cache JavaScript de Google fonctionne-t-il vraiment par origine et non par domaine ?
- 6:46 Pourquoi les outils de test Google ne reflètent-ils jamais ce que voit vraiment Googlebot ?
- 7:12 Faut-il vraiment ignorer le test en direct de la Search Console pour diagnostiquer vos problèmes d'indexation ?
- 7:12 Pourquoi Google ignore-t-il vos images lors du rendu pour l'indexation ?
- 15:16 Les outils de test Google donnent-ils vraiment les mêmes résultats ?
- 20:05 Les erreurs serveur intermittentes impactent-elles vraiment votre indexation Google ?
- 21:03 Google peut-il vraiment détecter les erreurs de rendu JavaScript sur mon site ?
Google officially recommends basing mobile/desktop adaptation on CSS media queries and screen size, not on user-agent detection. This guideline also applies to Core Web Vitals tests, which only change the screen size between mobile and desktop. Practically, this means that a site relying on user-agent to serve differentiated content risks inconsistencies between what Googlebot sees and what CWV tests measure.
What you need to understand
Why does the distinction between media queries and user-agent pose a problem?
User-agent detection has long been the default method for differentiating mobile and desktop. The server analyzes the string sent by the browser and serves a specific HTML version — often either two distinct URLs (m.example.com vs www.example.com) or two different templates.
The catch? Google crawls with variable user-agents (smartphone and desktop), but measuring tools like PageSpeed Insights or Chrome UX Report only change the window size. If your rendering logic relies on UA detection, you risk a gap between what Googlebot indexes and what CWV tests actually measure.
What are media queries and how do they differ from user-agent?
CSS media queries (@media screen and (max-width: 768px)) trigger styling rules based on viewport characteristics — width, height, orientation, pixel density. No server intervention, everything happens on the client side.
This is the foundation of responsive design: one URL, one HTML, and the CSS adapts. Googlebot loads the HTML, executes JavaScript if necessary, applies media queries based on the simulated size, and this aligns with CWV tests that do exactly the same — they resize the viewport without touching the UA.
Why does Google now emphasize this approach?
Because mobile-first indexing and Core Web Vitals both rely on renderings where screen size takes precedence. If you serve different content based on UA, Googlebot smartphone may index one version, but CWV tests may measure another if your CSS does not follow suit.
Google wants to simplify: one source of truth (the viewport), no dual server/client logic that creates discrepancies. It also makes the job easier for Googlebot, which no longer has to deal with URL variations or 302 redirects to a mobile version.
- Media queries ensure consistency between crawling, indexing, and CWV measurement.
- User-agent detection creates risks of desynchronization if the CSS does not follow the same logic.
- Google tests CWV by only changing the screen size, not the UA — so if your site relies on UA, metrics may be distorted.
- Pure responsive design (1 URL, 1 HTML, adaptive CSS) remains Google's preferred method to avoid misunderstandings.
SEO Expert opinion
Does this statement align with observed practices in the field?
Yes, but with an important nuance: many legacy corporate or e-commerce sites still operate with dynamic serving (different HTML based on UA) or mobile subdomains. They do not necessarily encounter indexing issues if the setup is clean — proper 302 redirects and alternate/canonical tags.
The real concern rises with Core Web Vitals. If your server detects a desktop UA and serves a heavy HTML, but PageSpeed Insights simulates a mobile viewport without changing the UA, it measures a desktop version on a mobile screen — as a result, your mobile CWV metrics are polluted by desktop content. [To verify] in certain edge cases where dynamic serving might still deliver the correct version if the CSS takes over, but it's fragile.
In what cases does user-agent detection remain legitimate?
Let's be honest: there are contexts where UA remains relevant. For example, detecting a specific bot to adjust crawl budget (serving pre-rendered HTML to bots, JS to users), or geolocating based on IP combined with UA for localized content.
But for pure responsive rendering — mobile vs desktop — it is clearly discouraged. If you absolutely must serve different HTML, make sure the final CSS applies the same breakpoints as your server logic, otherwise you create an inconsistency between what Googlebot crawls and what CWV measures.
What are common mistakes resulting from a poor approach?
A classic error: a site detects the mobile UA and serves lightweight HTML but forgets to load some critical CSS resources. As a result, the mobile LCP is good in theory, but PageSpeed Insights — which tests with a mobile viewport on a desktop UA — measures a truncated desktop version. Catastrophic CWV score while the actual user experience is fine.
Another frequent case: server-side A/B tests based on UA to serve variants. If Google crawls with a mobile UA and encounters variant A, but CWV tests with mobile viewport and desktop UA encounter variant B, you’re measuring two different experiences — and Google may index a version that does not match the CWV metrics displayed in Search Console.
Practical impact and recommendations
What should be prioritized in an existing site audit?
First step: check if your site actively detects user-agent on the server to serve different content. Inspect HTTP headers (Vary: User-Agent), server logs, or .htaccess / nginx rules. If you find dynamic serving, compare the HTML served to Googlebot smartphone vs desktop — use the Search Console Inspect URL tool for both versions.
Next, test your Core Web Vitals on PageSpeed Insights with mobile and desktop viewport. If the scores diverge significantly while the URL is the same and the CSS is supposed to adapt the rendering, it’s a red flag — your server logic and your CSS are not aligned.
How to migrate from a user-agent approach to media queries?
If you are on dynamic serving or a mobile subdomain (m.example.com), migrating to pure responsive design requires partial redesign. Consolidate into one URL, unify the HTML, and move all adaptation logic into the CSS with clear breakpoints (@media (max-width: 768px)).
During the transition, maintain 302 redirects from the old mobile to the unified version and update alternate/canonical tags to signal to Google that you are transitioning to responsive. Monitor Googlebot logs to confirm that it is crawling the unique version and that CWV remains stable post-migration.
What mistakes to avoid when implementing media queries?
Common mistake: setting CSS breakpoints that do not match Google's mobile-first thresholds (around 600-640px wide). If your main media query hits at 1024px, both Googlebot smartphone (viewport 360-412px) and mobile CWV tests (viewport 360px) will load the mobile version, but a tablet user (768px) may fall between the cracks.
Another trap: loading heavy resources (high-resolution images, third-party scripts) in the base HTML, then hiding them in CSS on mobile. Googlebot and CWV still measure the total downloaded weight — use conditional lazy loading or picture tags with srcset to actually serve less data on mobile.
- Audit HTTP headers (Vary: User-Agent) and server logs to detect active dynamic serving.
- Compare the HTML served to Googlebot smartphone vs desktop via Search Console Inspect URL.
- Test mobile and desktop CWV on PageSpeed Insights — an abnormal delta indicates a UA/viewport inconsistency.
- If migration is necessary, consolidate on 1 unique URL with responsive CSS and maintain temporary 302 redirects.
- Ensure your CSS breakpoints match Google's mobile-first thresholds (~ 600px).
- Don't hide heavy resources in CSS — optimize actual weight on the HTML side (picture, srcset, lazy loading).
❓ Frequently Asked Questions
Peut-on encore utiliser du dynamic serving sans pénalité SEO ?
Les tests Core Web Vitals changent-ils réellement l'user-agent ou seulement la taille d'écran ?
Si mon site est 100% responsive avec media queries, dois-je quand même vérifier quelque chose ?
Comment savoir si mon site sert du contenu différent selon l'user-agent ?
La migration d'un sous-domaine mobile (m.example.com) vers du responsive impacte-t-elle le ranking ?
🎥 From the same video 12
Other SEO insights extracted from this same Google Search Central video · duration 26 min · published on 15/10/2020
🎥 Watch the full video on YouTube →
💬 Comments (0)
Be the first to comment.