=== AnyReplay ===
Contributors: techbaem
Tags: session replay, session recording, analytics, user behavior, ux
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Watch how visitors use your site. Records sessions with AnyReplay: paste your project key and every front-end page is recorded.

== Description ==

AnyReplay records what visitors do on your site, clicks, scrolls, taps and the pages they move through, so you can watch a session back and see where people got stuck.

This plugin adds the AnyReplay recorder to your front-end pages. It is the same script you would otherwise paste into your theme, with a settings page instead of code:

* **Project key** from your AnyReplay project.
* **Mask form fields**, on by default, so what visitors type replays as asterisks. Untick it to see typed values.
* **Wait for consent** using the WP Consent API, so nothing is recorded until a visitor allows statistics cookies.
* **Sample rate** and a **monthly session cap** to control how much is recorded.
* **Skip administrators** so your own visits do not fill the session list.

The admin area is never recorded. You need an AnyReplay account; the free plan includes a monthly allowance of sessions.

= External service =

This plugin loads a script from AnyReplay and sends recordings to AnyReplay. It does nothing until you save a project key.

* The recorder is loaded from `https://cdn.anyreplay.com` on every front-end page that records.
* Recordings (page structure, mouse and touch movement, clicks, scrolls, typed values unless masked, page URLs, browser and device type, console errors and network request timings without bodies) are sent to `https://in.anyreplay.com`, or to the ingest URL you set.
* Service: AnyReplay, operated by Baem Tech. Terms: https://anyreplay.com/legal/terms. Privacy policy: https://anyreplay.com/legal/privacy.

== Installation ==

1. Install the plugin from **Plugins → Add New** and activate it.
2. In AnyReplay, open your project's setup page and copy the project key.
3. In WordPress, open **Settings → AnyReplay**, paste the key and save.
4. Open your site in a private window and click through a few pages. The setup page in AnyReplay switches to **Connected** when the first events arrive.

If a caching or optimisation plugin delays or combines JavaScript, exclude `cdn.anyreplay.com/v1/ar.min.js` and the inline AnyReplay script from it and clear the cache.

== Frequently Asked Questions ==

= Is AnyReplay GDPR compliant? =

AnyReplay is built to be used in compliance with the GDPR, but compliance depends on how you use it. Turn on **Wait for consent** if your site asks visitors for consent before analytics, keep **Mask form fields** on for pages with personal data, and mention session recording in your privacy policy. AnyReplay offers a data processing agreement at https://anyreplay.com/legal/dpa.

= Does it work with my cookie banner? =

With **Wait for consent** on and a consent plugin that supports the WP Consent API (for example Complianz or CookieYes), recording starts only after a visitor allows the statistics category, and stops if they withdraw it. Other consent tools can switch on the same wait with the `anyreplay_require_consent` filter and call `anyreplay('consent', true)` from their own "accepted" callback.

= What is never recorded? =

Passwords, one-time codes and payment card fields are masked whatever you choose, and so is any value that looks like a card number. Add the CSS class `ar-mask` to a block to mask its text, or `ar-block` to leave it out of recordings altogether.

= Does it record the WordPress admin? =

No. The recorder is only added to front-end pages, and logged-in administrators are skipped by default.

= Does it work with WooCommerce? =

Yes, on pages your theme renders, including product, cart and checkout pages. Keep **Mask form fields** on for a shop.

= Can I use it with a self-hosted AnyReplay? =

Yes. Set the ingest URL to your own server. To load the recorder from your own host too, use the `anyreplay_cdn_url` filter.

= Which hooks are there? =

* `anyreplay_should_record` (bool) — skip recording on some pages.
* `anyreplay_init_options` (array) — change the options passed to the recorder.
* `anyreplay_require_consent` (bool) — wait for consent without the setting.
* `anyreplay_consent_category` (string) — the WP Consent API category, `statistics` by default.
* `anyreplay_cdn_url` (string) — where the recorder is loaded from.

== Screenshots ==

1. Settings → AnyReplay: project key, privacy and recording options.
2. A recorded session playing back in AnyReplay, with the event list beside it.

== Changelog ==

= 0.1.0 =
* First release: project key, masking, consent through the WP Consent API, sample rate, monthly cap and skipping administrators.

== Upgrade Notice ==

= 0.1.0 =
First release.
