WordPress
Add WysLeap to a WordPress site with the WysLeap Analytics plugin: paste your site ID and API key, no theme editing.
The free WysLeap Analytics plugin, from the WordPress.org plugin directory, adds the WysLeap script to every page of your WordPress site. You paste your site ID and API key once; you don't edit your theme.
Install the plugin
Get your site ID and API key
In WysLeap, add your site if you haven't yet. Both values are in the site's Settings, under Install. The API key is the browser key.
Install WysLeap Analytics
In WordPress, go to Plugins → Add New, search for WysLeap Analytics, then install and activate it. You need WordPress 6.0 or later and PHP 7.4 or later. You can also download it from WordPress.org and upload the zip there.
Paste your keys
Go to Settings → WysLeap Analytics, paste your site ID and API key, and save.
Check it's working
Visit your site in a private window, then open your WysLeap dashboard. Visits appear after a minute or two.
Already pasted the WysLeap snippet into your theme?
Remove it from your theme, or from your header and footer plugin, before you activate WysLeap Analytics. Otherwise every page view is counted twice.
Settings
| Setting | What it does |
|---|---|
| Collect | Page views are always collected. Clicks, scroll depth and session replay are on by default; untick any you don't want. Session replay masks form fields and sensitive text. |
| Don't track | Logged-in users with these roles aren't tracked, so your own visits stay out of your numbers. Administrators and editors are ticked by default. |
| Consent | Track every visitor (default), or wait for "statistics" consent from your cookie banner (below). |
The plugin never tracks admin pages, post previews, the Customizer or feeds.
Waiting for consent
Waiting for consent works with cookie banners that support the WP Consent API. With it chosen, tracking starts only after the visitor allows "statistics", and withdrawing consent opts them out.
Keep the WP Consent API plugin active
This setting needs the WP Consent API plugin, plus a banner that supports it. If WP Consent API isn't active, WysLeap Analytics tracks every visitor, even with this setting chosen. The settings page tells you when that's the case.
The plugin also suggests text for your privacy policy under Settings → Privacy.
Caching
Caching plugins are fine. The script runs in the visitor's browser, so cached pages are tracked as usual.
WooCommerce orders
The plugin tracks your store's pages, but it doesn't send orders. To see revenue and products, add a purchase event to your order confirmation page. See Purchases and revenue.
For developers
| Filter | Use it to |
|---|---|
wysleap_analytics_should_track | Return false to skip tracking on a page. |
wysleap_analytics_init_config | Change the config passed to WysLeap.init(). |
For example, to stop tracking a members-only area:
add_filter( 'wysleap_analytics_should_track', function ( $track ) {
return is_page( 'members' ) ? false : $track;
} );