WordPress
Add the Patchrooms loader to your site through your theme’s functions.php or a header/footer plugin — no page templates to edit by hand.
Prerequisites
Section titled “Prerequisites”- Admin access to the WordPress dashboard (Appearance → Theme File Editor, or a plugin that inserts scripts).
- A project key (
pr_…) from your Patchrooms dashboard, under Settings.
Option 1: functions.php in a child theme
Section titled “Option 1: functions.php in a child theme”Hook the script into wp_footer so it prints on every page, right before </body>:
Directorywp-content/
Directorythemes/
Directoryyour-child-theme/
- functions.php
add_action( 'wp_footer', function () { ?> <script src="https://room.patchrooms.com/v1/patchrooms/pr_xxx.js"></script> <?php} );Replace pr_xxx with your project key. Use a child theme — edits to a parent theme’s functions.php are wiped out on the next theme update.
Option 2: a header/footer plugin
Section titled “Option 2: a header/footer plugin”If you don’t maintain a child theme, any plugin that inserts arbitrary scripts into the site header/footer works. WPCode is the most widely used one: add a new Header & Footer snippet, paste the <script> tag, set it to load in the Footer, and save. There’s no Patchrooms-specific plugin — this is a generic script insertion, same as for any other embed.
Restrict the widget to staging
Section titled “Restrict the widget to staging”If you only want the widget on a staging copy of the site (not production), gate the wp_footer hook by domain:
add_action( 'wp_footer', function () { if ( strpos( home_url(), 'staging.example.com' ) === false ) { return; } ?> <script src="https://room.patchrooms.com/v1/patchrooms/pr_xxx.js"></script> <?php} );Then add that staging domain to Allowed origins in your project’s Settings tab. If the list is non-empty, the server only accepts reports whose page Origin matches it — so the loader stays inert anywhere else, even if the script leaks into another environment.
Verify it works
Section titled “Verify it works”-
Load the page (staging or production, depending on which host you wired up).
-
Confirm the Patchrooms launcher appears docked to the edge of the viewport.
-
Click it, leave a text block, and submit. The report should appear in your project’s Feedback tab within a few seconds.
If the launcher doesn’t show up, see Troubleshooting — the most common cause is a cached page (WordPress page caching plugins can serve an old copy without the script) or a leftover pr_xxx placeholder key.