Set up the waiting room in one line.
Three steps. The only one that touches your site is pasting a single line.
Steps
-
Get your site ID
We set up your site and send you an ID. During early access we do this by hand.
No ID yet? Ask for one, or try it with site_demo.
-
Paste this into your page's <head>
<script src="https://fourway.io/w.js" data-site="site_demo" data-hold="/api/"></script>Put it on every page, above your other scripts.
data-holdkeeps calls to/api/waiting until the visitor is in; change it to your own paths, or leave it out. -
Check that it works
That is it. On a calm day nobody waits, so you will not see the line. Watch it in the demo.
Optional extras
Pause bots during a rush
Add two lines at the very top of your site's PHP entry file. While your site is busy, AI crawlers and scripts are asked to come back later. People and search engines pass.
require __DIR__ . '/fourway_gate.php';
fourway_bot_gate('site_demo');Get fourway_gate.php, or a Cloudflare Worker version, from the docs.
Only let in visitors with a pass
For checkout or sign-up, you can refuse anyone who skipped the line. Add data-pass="1" to the script and check the pass on your server with the code in the docs.
Expecting a very big spike?
Let your host or CDN cache your pages for a few seconds. The page loads before the script runs, so caching keeps a rush of page views off your server.
Something not working?
I never see the wait screen
That is normal on a calm site. Open the demo, or ask us for test mode.
The script is blocked
Add https://fourway.io to script-src and connect-src in your Content Security Policy.
API calls run too early
Load the script first in the head, without async.
Something else
Run the check in step 3 and send us what it says.
Ready for your biggest day?
Ask for a site ID and you can be live this afternoon. Or watch a rush in the demo first.