Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

How to Set Viewport and Device Scale Factor for SEO Screenshots in Puppeteer

Configure Puppeteer’s viewport and device scale factor before navigation, capture the rendered page, and use screenshots as responsive checks—not proof of Googlebot’s crawl.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set Puppeteer’s viewport width, height, and deviceScaleFactor before navigating, then capture the page after it loads. For example, use 390 × 844 CSS pixels at scale factor 1 to inspect one mobile layout—but that is an example, not a Google-prescribed SEO size. Google does not specify one universal screenshot viewport, and a local screenshot cannot prove what Googlebot crawls.

Set the viewport before navigating

Use page.setViewport() to configure the CSS viewport and device pixel density together. Create the page, set the viewport, navigate, and then take the screenshot:

As an Amazon Associate I earn from qualifying purchases.

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();

    await page.setViewport({
      width: 390,
      height: 844,
      deviceScaleFactor: 1,
    });

    await page.goto('https://example.com', { waitUntil: 'networkidle2' });
    await page.screenshot({ path: 'page.png', fullPage: true });
  } finally {
    await browser.close();
  }
})();

The values are CSS pixels for the viewport and an emulated density factor, not a claim about a particular phone’s physical screen. Change the dimensions to match the responsive layout you need to inspect, and choose a scale factor for the image density you want. Puppeteer’s Page.setViewport API documents these options and advises setting the viewport before navigation because some sites do not expect the viewport to change after loading begins.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The example uses networkidle2 as one practical navigation wait condition, not as proof that every page is finished rendering. Pages with ongoing network activity, lazy content, animations, or delayed components may need a different wait strategy; use a selector or another condition appropriate to the page before capture.

Choose a viewport that answers your SEO question

There is no single “SEO viewport” specified by Google for Puppeteer screenshots. Select dimensions based on the responsive state you want to review: for example, a narrow mobile layout, a wider mobile layout, or a desktop breakpoint. A controlled set of explicit dimensions makes repeated captures easier to compare.

Keep CSS viewport dimensions separate from device scale factor. Width and height determine the layout viewport the page responds to; deviceScaleFactor emulates screen density and affects the pixel density represented in the capture. A physical display can use multiple physical pixels for one CSS pixel, so a device’s advertised pixel resolution is not automatically the viewport width to enter. See Google’s responsive design explanation for this stable distinction; its historical device-size examples should not be treated as current sizing guidance.

Use a known device profile when you need one

If you want a Puppeteer device profile rather than a manually controlled viewport, use KnownDevices and page.emulate(device). Emulation applies the selected device’s user agent and viewport together. Set it before navigation as well:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const puppeteer = require('puppeteer');
const { KnownDevices } = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    const device = KnownDevices['iPhone 13'];

    await page.emulate(device);
    await page.goto('https://example.com', { waitUntil: 'networkidle2' });
    await page.screenshot({ path: 'device.png', fullPage: true });
  } finally {
    await browser.close();
  }
})();

Use the device name available in the Puppeteer version installed in your project. For a repeatable viewport test matrix, explicit width, height, and scale factor provide direct control; for a device-oriented check, emulation conveniently applies a profile’s viewport and user agent. Puppeteer’s Page.emulate API documents the device-emulation method. Puppeteer also notes that setting a viewport can reload a page in some cases involving isMobile or hasTouch, another reason to apply the desired configuration before navigation.

What the screenshot can—and cannot—tell you about SEO

Google says it uses the mobile version of a site’s content, crawled with the smartphone agent, for indexing and ranking, and recommends responsive design as the easiest design pattern to implement and maintain. A Puppeteer capture can help you spot layout breakage, missing visible content, or responsive-state differences at the dimensions you chose. It is a local rendering check, not evidence that Googlebot received the same content or resources.

Check the mobile experience separately for the content and resources Google needs to discover. Google warns that primary content which loads only after a user gesture such as swiping, clicking, or typing may not be seen by Googlebot. Matching a screenshot’s viewport alone does not ensure the same user agent, resource access, or page behavior as Google’s crawler. See Google’s mobile-first indexing best practices.

deviceScaleFactor controls screenshot emulation density; the reviewed Google guidance does not prescribe a value for it or say that choosing a particular value improves rankings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Or skip the browser setup

ScreenshotNeo can return a screenshot with one request. See the ScreenshotNeo API documentation for request options.

Best Value
The SQL Programming Language: .
  • Used Book in Good Condition
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie and consent banners before capture and removes 60+ known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Learn about ScreenshotNeo, or sign up free for 1,000 screenshots a month with no card.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting Puppeteer captures

  • The page uses the wrong responsive layout: Set the viewport before goto() and verify the dimensions are CSS pixels. If you need mobile user-agent behavior as well, use a device profile with page.emulate().
  • The page reloads after changing emulation: Avoid changing viewport settings after navigation. Puppeteer documents reload behavior in certain cases involving isMobile or hasTouch.
  • The screenshot is incomplete: Navigation completion does not guarantee that delayed or lazy content has rendered. Wait for a relevant selector or a page-specific readiness condition before calling screenshot(); avoid relying on an arbitrary delay where a concrete condition is available.
  • The screenshot looks sharper or larger than expected: Review deviceScaleFactor separately from viewport width and height. Density changes the captured pixel representation; it does not select a different CSS breakpoint by itself.
  • The screenshot looks right, but SEO content is still missing: A screenshot only shows the local browser’s rendered result. Confirm that important content and required resources are available to Google’s smartphone crawler and do not depend solely on user gestures.

Capture options that affect interpretation

fullPage: true captures beyond the initial viewport, which is useful for reviewing content lower on the page but does not represent only the initial visible screen. For a viewport-only screenshot, omit that option. In either case, configure viewport and emulation before navigation, then use page.screenshot() after the page is ready. Puppeteer’s screenshots guide and Page.screenshot API describe capture behavior and options.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does deviceScaleFactor affect SEO rankings?

No ranking effect is established by the cited guidance. It controls emulated capture density; Google does not prescribe a screenshot scale-factor value.

Should I use a fixed 390 × 844 viewport for every mobile SEO check?

No. Those dimensions are only an example. Choose dimensions that exercise the responsive layout or breakpoint you need to inspect.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.