WordPress plugin to add and manage the Rybbit tracking script on your sites. Rybbit is an open source and privacy-focused web analytics platform.
Get the plugin from the WordPress.org plugin directory.
- Works with Rybbit Cloud and with self-hosted Rybbit instances.
- Analytics dashboard in wp-admin (optional, needs a Rybbit API key): a widget on the WordPress dashboard and a page at
Dashboard>Rybbit Analytics. It shows visitors, pageviews, bounce rate, visit duration, visitors online, a chart and the top pages, referrers, countries, devices and browsers. - Do not track selected user roles. Administrators are excluded by default.
- Optional tracking inside wp-admin. It is off by default.
- Load the script with
defer(recommended) orasync. - Skip patterns and mask patterns for URL paths, with wildcards (
*,**) and regular expressions (re:prefix). - Add a custom tag to all events.
- Optional user identification for logged-in users, in pseudonymized or full mode. User ID strategies: WordPress scoped ID, keyed hash (HMAC), user ID, login, email or a user meta field.
- Session replay privacy settings: block, ignore and mask elements, mask inputs, sampling and DOM slimming.
- Custom events: send an event to Rybbit when a visitor clicks an element. You set a CSS selector, an event name and
optional properties on the
Custom Eventstab. You do not need to write JavaScript. - Debug tab with the effective settings and the generated script attributes.
- Opt-out for visitors: the shortcode
[rybbit_optout]and the blockRybbit Opt-outshow a button. A visitor can turn the analytics off and on again. See Visitor opt-out. - Developer filters:
integrate_rybbit_should_track,integrate_rybbit_script_attributes,integrate_rybbit_identify_user_id,integrate_rybbit_identify_traits,integrate_rybbit_custom_events,integrate_rybbit_dashboard_capability,integrate_rybbit_api_http_argsandintegrate_rybbit_optout_html. See readme.txt for details and an example.
- WordPress 6.5 or newer
- PHP 7.4 or newer
The recommended way is the WordPress.org plugin directory:
- In wp-admin, go to
Plugins>Add New. - Search for "Integrate Rybbit", then click
Install NowandActivate.
To install a release from GitHub:
- Download
integrate-rybbit.zipfrom the latest release. - In wp-admin, go to
Plugins>Add New>Upload Plugin. - Select the zip file, click
Install Nowand thenActivate Plugin.
- Go to
Settings>Integrate Rybbit. - Enter your Rybbit Site ID.
- If you host Rybbit yourself, set the Script URL to
https://your-rybbit-domain/api/script.js. - Save the settings.
All other settings are optional.
The dashboard reads the numbers from the Rybbit API. It needs an API key.
- In Rybbit, go to
Organization settings>API keysand create a key. - In WordPress, go to
Settings>Integrate Rybbit>Dashboard, enter the key and save. - Click
Test connection. After this, the widget and the pageDashboard>Rybbit Analyticsare available.
Notes:
- Rybbit Cloud offers API keys on the Standard plan and above. Self-hosted instances have no such limit. The tracking works on every plan.
- The key only needs read access to
Analytics. A key without restrictions also works. If you restrict the key to some resources, selectAnalyticswithread. Otherwise Rybbit answers with403and the plugin shows the missing permission. - The "Open Rybbit" button needs the number of the site (for example
/29). The plugin reads it from the site settings, which needsSiteswithread. Without it, the button opens the start page of Rybbit. - You can define the key in
wp-config.phpinstead of the database. This key replaces the saved key:define( 'INTEGRATE_RYBBIT_API_KEY', 'your-key' ); - The key stays on the server. The browser only talks to a REST route of your site (
integrate-rybbit/v1/stats). - The plugin caches the API answers (10 minutes by default) to save API requests.
- Only users with the capability
manage_optionssee the dashboard. Change it with the filterintegrate_rybbit_dashboard_capability.
Visitors can turn the analytics off for their browser. Add the shortcode to a page, for example your privacy policy:
[rybbit_optout]
In the block editor, use the block Rybbit Opt-out. The block has a Texts panel in the sidebar.
| Attribute | Description |
|---|---|
optout_label |
Text of the button that turns the analytics off. |
optin_label |
Text of the button that turns the analytics on. |
tracked_text |
Status text while the analytics is on. |
untracked_text |
Status text while the analytics is off. |
class |
Extra CSS classes for the wrapper element. |
Example:
[rybbit_optout optout_label="Stop tracking me" tracked_text="We count your visit." class="my-style"]
Notes:
- The choice is saved in the local storage of the browser under the key
disable-rybbit. It applies to this website and this browser only. A visitor who clears the browser data also clears the opt-out. - The choice takes effect on the next page load. The Rybbit script reads it once at start.
- The opt-out needs the Rybbit script v1.1.0 or newer. Old self-hosted instances may ignore it.
- If you set
data-namespacewith the filterintegrate_rybbit_script_attributes, the key isdisable-<namespace>. The plugin uses the same namespace automatically. - Without a Site ID, only administrators see a notice instead of the button.
- Use the filter
integrate_rybbit_optout_htmlto change the HTML. The second argument is the array of texts.
More screenshots are in the assets folder.
If you previously used this plugin under the name "Rybbit Analytics", you can safely uninstall that version after activating this new plugin. You need to re-enter your Site ID in the new plugin settings, as the configuration does not carry over automatically.
All PHP and WordPress tools run in Docker. You only need Docker (with Compose), make and zip on your computer.
make help # Show all targets.
make check # Run all checks: lint, phpcs and plugin-check.
make dev # Start WordPress with the plugin active.
make down # Stop WordPress.| Target | Description |
|---|---|
make check |
Runs lint, phpcs and plugin-check. CI runs the same targets. |
make lint |
Checks the PHP syntax with PHP 7.4 to 8.5. Use PHP_VERSIONS="8.4" for one version. |
make phpcs |
Checks the coding standards (WordPress Coding Standards and PHPCompatibilityWP). |
make phpcbf |
Fixes coding standard issues that can be fixed automatically. |
make dev |
Starts WordPress at http://localhost:8080 with the plugin active (admin / admin). |
make plugin-check |
Runs the official Plugin Check. |
make test-dashboard |
Tests the analytics dashboard backend against the mock Rybbit API. |
make test-optout |
Tests the opt-out shortcode and block, with a headless browser in Docker. |
make pot |
Generates build/integrate-rybbit.pot to review the translatable strings. |
make translations |
Compiles the .po files in integrate-rybbit/languages/ to .mo and JSON files. |
make screenshots |
Retakes the screenshots in assets/ with a headless browser in Docker. |
make logs |
Shows the WordPress debug log. |
make down |
Stops the development environment. |
make clean |
Stops the development environment and deletes all data and build files. |
make zip |
Builds integrate-rybbit.zip for a manual upload. |
Notes:
- The plugin folder is mounted read-only into the WordPress container. Changes are visible after a page reload.
- Use
WP_PORT=8081 make devif port 8080 is in use. - Use
WP_IMAGE_TAG=6.5 make devto test with an older WordPress version. Start withmake cleanwhen you change the WordPress version. - To update a translation: run
make pot, merge the new strings withmsgmerge --no-fuzzy-matching --backup=none -U integrate-rybbit/languages/integrate-rybbit-de_DE.po build/integrate-rybbit.pot, translate the new entries and runmake translations. Commit the.po,.moand.jsonfiles. make screenshotsoverwrites the plugin settings of the development site with example values.make devalso starts a mock of the Rybbit API (tools/mock-rybbit) with fixed demo data and connects the development site to it (API keydemo-key). It is available at http://localhost:3001. These keys trigger errors:bad-key(401),forbidden-key(403) andslow-key(429).- The settings are stored with the option prefix
rybbit_. The plugin migrates old settings on update (optionintegrate_rybbit_db_version).
integrate-rybbit/ The plugin. Only this folder is deployed to WordPress.org.
assets/ Icons and screenshots for WordPress.org.
tools/ Docker setup for the checks and the development environment.
tools/mock-rybbit/ Mock of the Rybbit Stats API for the dashboard tests and the screenshots.
tools/tests/ Tests that run inside the development WordPress.
phpcs.xml.dist PHPCS rules.
.github/workflows/ CI and release workflows.
- Make sure that
Tested up toin readme.txt is the current WordPress version. Plugin Check fails when a new major WordPress version is available and this value is older. - Publish a GitHub release with a new tag
vX.Y.Z. The release notes become the changelog on WordPress.org. - The release workflow does these steps:
- Sets the version in the plugin header, the
INTEGRATE_RYBBIT_VERSIONconstant and theStable tag. - Writes the notes of the last 10 GitHub releases into the changelog of
readme.txt. - Runs all checks.
- Deploys the plugin and the assets to WordPress.org.
- Attaches
integrate-rybbit.zipto the GitHub release.
- Sets the version in the plugin header, the
Pre-release tags (for example v1.8.0-rc.1) are not deployed to WordPress.org. Mark these releases as pre-release on GitHub.
The version in the repository is always 0.0.0. Do not change it manually.
This is a free and open-source WordPress plugin developed independently for integration with Rybbit and licensed under the GNU General Public License v3 or later.
The use of the Rybbit name and logo in this plugin has been explicitly approved by the owner of Rybbit. All Rybbit trademarks, logos, and brand assets remain the property of their respective owner.
This plugin is not an official Rybbit product and is not otherwise affiliated with or endorsed by Rybbit.


