Using Cloudflare Workers to run an SEO Test on the Edge using SEO Scout

One of the best ways to ensure your test gets indexed by Google promptly is to serve the changes you are making as pure HTML.

If your site is on Cloudflare - or if you are prepared to switch - you can ensure your tests index immediately by adding our Cloudflare worker to your site.

The changes to your site are run at 'the edge' - eg at Cloudflare's CDN, after your server has done its job yet before the content is served to the browser.

This means the HTML that your visitors - or Google - downloads already includes the changes you are testing. No waiting for Javascript rendering, and no plugins needed on your server whatsoever.

To get started, all you need to do is add our Cloudflare worker to your account. Here's how:

Adding the Worker to Cloudflare

  1. Log into Cloudflare and click on the 'Workers' section
  2. If this is your first time using Cloudflare you will need to choose a plan. It is currently free for up to 100,000 requests per day. You'll also be asked to name a subdomain for your workers.
  3. Click 'Create A Worker'. This will take you to a page that acts as a script editor
  4. Delete the content in the left hand pane
  5. Cut and paste in the code from your site's 'Snippet' page on SEO Scout. Note the name they have given your worker, below the Cloudflare logo. You can edit this to include your domain name to make it easier to remember.
  6. Click Save and Deploy then confirm.

Enabling the worker on your account

Once this is done, you're ready to enable the worker on your site.

  1. Return to the Cloudflare dashboard and select the site you wish to run tests on
  2. Click on the 'Workers' tab
  3. Click the button labelled Add Route
  4. In the route box, enter yourdomain.com/ - this will match all the pages on your domain.
  5. If you're near your limit of requests per day, you could run the worker on a specific section of your site only, such as yourdomain.com/reviews/. Just remember to update it if you wish to test a different area.
  6. If your'e on the free plan it's a good idea to open the 'Request Limit failure mode' dropdown and change it to 'Fail Open'. This means that if you exceed the daily request limit your site will still be served to users, although your tests won't run. This is far better than your site going offline in case of a traffic spike!
  7. Choose your worker from the select box and click Save
  8. Your tests will now go live automatically across your site whenever you add them in SEO Scout!

If you get stuck with any of the above, you are welcome to add support@abrankings.com as a Member of your account and we'll help you get setup.