Speculation Rules Builder
A builder widget for Speculation Rules. During testing or implementation, DevTools can be used to debug your implementation.
Your changes are saved automatically on this device and in this browser, and will be available when you return to this page as long as your local storage is preserved.
Your rules
No rules added (yet).
Add a or
Preferred implementation
Script tag with
type=speculationrules allows for embedding in your HTML or template files
JS inject is convenient for:
- testing the result in DevTools Console without deploying it yet
- deploying it via GTM
Custom HTML(hence usingvar) - changing rules during the page life cycle (SPA navigation, A/B tests, logged-in vs logged-out)
- cancellation or refreshing of speculation rules
JSON-only allows for serving as
response header, i.e.
Speculation-Rules: "/assets/speculation-rules.json"