What does Google say about SEO? /
Quick SEO Quiz

Test your SEO knowledge in 3 questions

Less than 30 seconds. Find out how much you really know about Google search.

🕒 ~30s 🎯 3 questions 📚 SEO Google

Official statement

To adapt your site to different screen sizes (mobile vs desktop), rely on CSS media queries and screen size, not on user-agent. This also applies to Core Web Vitals tests that only change the screen size between mobile and desktop.
12:28
🎥 Source video

Extracted from a Google Search Central video

⏱ 26:24 💬 EN 📅 15/10/2020 ✂ 13 statements
Watch on YouTube (12:28) →
Other statements from this video 12
  1. 0:32 Le service de rendu Google bloque-t-il vos ressources cross-origin à cause de CORS ?
  2. 1:03 Les données dupliquées dans vos balises script pénalisent-elles vraiment votre SEO ?
  3. 1:03 La lazy hydration peut-elle vraiment tuer votre crawl budget ?
  4. 2:08 Pourquoi Google ne peut-il pas partager le cache JavaScript entre vos domaines ?
  5. 2:41 Google sur-cache-t-il vraiment les ressources de votre site ?
  6. 4:14 Le cache JavaScript de Google fonctionne-t-il vraiment par origine et non par domaine ?
  7. 6:46 Pourquoi les outils de test Google ne reflètent-ils jamais ce que voit vraiment Googlebot ?
  8. 7:12 Faut-il vraiment ignorer le test en direct de la Search Console pour diagnostiquer vos problèmes d'indexation ?
  9. 7:12 Pourquoi Google ignore-t-il vos images lors du rendu pour l'indexation ?
  10. 15:16 Les outils de test Google donnent-ils vraiment les mêmes résultats ?
  11. 20:05 Les erreurs serveur intermittentes impactent-elles vraiment votre indexation Google ?
  12. 21:03 Google peut-il vraiment détecter les erreurs de rendu JavaScript sur mon site ?
📅
Official statement from (5 years ago)
TL;DR

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.

Attention: If you use dynamic serving for performance reasons (serving pre-rendered HTML to bots), meticulously document the logic and ensure that CWV tests remain consistent with what Googlebot indexes. A delta of more than 10-15% between CrUX mobile and desktop on the same pages is a warning signal.

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).
Alignment between media queries and CWV tests has become a non-negotiable technical prerequisite. If your current architecture relies on dynamic serving or mobile subdomains, consider a gradual redesign towards pure responsive design — it’s a technical project that touches both frontend, backend, and crawl budget. For complex sites or teams less familiar with modern responsive design, engaging a specialized SEO agency can expedite the transition while securing CWV metrics and mobile-first indexing.

❓ Frequently Asked Questions

Peut-on encore utiliser du dynamic serving sans pénalité SEO ?
Oui, à condition que le HTML servi soit cohérent entre Googlebot smartphone et desktop, et que les balises alternate/canonical soient propres. Mais les tests CWV risquent de mesurer une version incohérente si le CSS ne suit pas la même logique que le serveur.
Les tests Core Web Vitals changent-ils réellement l'user-agent ou seulement la taille d'écran ?
Ils changent uniquement la taille du viewport (360px pour mobile, 1920px pour desktop). L'user-agent reste celui d'un navigateur Chrome desktop standard, ce qui peut créer un décalage si votre serveur détecte l'UA pour servir du contenu différent.
Si mon site est 100% responsive avec media queries, dois-je quand même vérifier quelque chose ?
Oui, vérifiez que vos breakpoints CSS correspondent bien aux seuils utilisés par Google (environ 600px pour mobile). Testez aussi que vous ne chargez pas de ressources lourdes masquées en CSS — ça plombe quand même les CWV.
Comment savoir si mon site sert du contenu différent selon l'user-agent ?
Inspectez les headers HTTP (Vary: User-Agent), comparez le HTML renvoyé via curl avec différents UA, et utilisez Search Console Inspect URL en mode smartphone puis desktop pour voir si le HTML diffère.
La migration d'un sous-domaine mobile (m.example.com) vers du responsive impacte-t-elle le ranking ?
Non, si elle est bien exécutée avec des redirects 302 propres et une mise à jour des alternate/canonical. En revanche, surveillez les CWV pendant la transition — un HTML unifié mais mal optimisé peut dégrader temporairement le LCP ou le CLS.
🏷 Related Topics
Domain Age & History AI & SEO Mobile SEO Web Performance

🎥 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 →

Related statements

💬 Comments (0)

Be the first to comment.

2000 characters remaining
🔔

Get real-time analysis of the latest Google SEO declarations

Be the first to know every time a new official Google statement drops — with full expert analysis.

No spam. Unsubscribe in one click.