How do I verify if my Prerender integration is working correctly?
  • 22 Nov 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

How do I verify if my Prerender integration is working correctly?

  • Dark
    Light
  • PDF

Article summary

How to Verify Prerender.io Integration

This guide will help you check if Prerender.io is working correctly on your site. While the used fuctions are available in other browsers as well we recommend using Google Chrome for this process.

Step-by-Step Verification Process

  1. Open your website: Navigate to the URL you want to test.

  2. Access Developer Tools:

    • Windows: Press Ctrl + Shift + J
    • Mac: Press Option + ⌘ + J
  3. Show Network Conditions:

    • Windows: Press Ctrl + Shift + P
    • Mac: Press Command + Shift + P
    • Type "Show Network Conditions" and select it

1.png

  1. Modify User Agent:
    • In the Network Conditions tab, find "User Agent"
    • Uncheck "Use browser default"
    • Select "Googlebot" from the dropdown list
      (Note: If you've modified the allow list in your Prerender config, choose a bot that's allowed)

P9j0qBocKI

  1. Reload your site

  2. Check for Prerender header:

    • Switch to the Network tab
    • Look at the first connection's headers
    • If you see "x-prerender-requestid" in the response, Prerender.io is working correctly

2.png

Bot Validation Scenario

If your website uses bot validation, the above method might not work as it may block requests from non-authentic bot IP addresses. In this case:

  1. Add a custom user agent to your Prerender integration or select one that isn't strictly validated
  2. Follow the above steps, but instead of selecting Googlebot, use your custom user agent
  3. Optionally, you can add your preferred SEO tool's crawler user agent to your integration

For more details on adding bots, refer to this guide.

Common Issues and Solutions

Empty HTML Response

If you're only getting:

<html><head></head><body></body></html>

This typically occurs with frameworks using blocking I/O (e.g., Rails). Switch to a server that supports multiple processes or non-blocking I/O (like Unicorn or Puma) to avoid deadlocks when Prerender renders your page.

JavaScript Still Visible

If you're still seeing JavaScript instead of static HTML, your Prerender middleware might not be executing early enough. Try moving your Prerender middleware configuration higher in your code to ensure it runs first.

Partial Page Rendering

If your page is only partially rendered, you can use the window.prerenderReady flag to control when Prerender saves the HTML:

  1. Add this to your HTML:
<script>window.prerenderReady = false;</script>
  1. Set it to true when your page is ready
    (for example after an AJAX call):
window.prerenderReady = true;

This ensures Prerender waits until your page is fully loaded before saving the HTML.


Was this article helpful?

What's Next