=== Statsy Analytics ===
Contributors: statsy
Tags: analytics, privacy, woocommerce, revenue, statistics
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Privacy-friendly analytics that shows which channels bring paying customers. Cookieless for EU visitors, with WooCommerce revenue built in.

== Description ==

Statsy is web analytics with revenue attribution. It ties every sale to the post, search or campaign that brought the buyer, and includes session replays, heatmaps, goals and funnels on every plan.

This plugin connects your WordPress site to Statsy in under a minute:

* Adds the lightweight Statsy script (about 2 KB) to every public page.
* Skips your own visits: choose which roles are never counted.
* Captures site searches, downloads, outbound links, form submissions and video plays with no code. WordPress search is picked up automatically.
* Cookieless for visitors in the EU, EEA, UK and Switzerland by default. Honours Do Not Track and Global Privacy Control.
* WooCommerce: records a purchase goal on the order received page, and can send every paid order and refund to Statsy as revenue from your server, credited to the channel that brought the buyer.
* Optional: show signed-in users by name in visitor journeys.

A Statsy account is required. Every feature is included in the 14-day free trial.

= External service =

This plugin loads a script from statsy.co (or your own first-party domain) and sends page views and events to Statsy, which is the analytics service it connects to. When a revenue API token is set, paid WooCommerce orders and refunds are sent from your server to the Statsy API: order id, total, currency, billing email and the Statsy visitor id. Nothing is sent until you enter a website key.

* Service: https://statsy.co
* Terms of service: https://statsy.co/terms
* Privacy policy: https://statsy.co/privacy

== Installation ==

1. Install and activate the plugin from Plugins › Add New, or upload the zip.
2. Go to Settings › Statsy.
3. Paste your website key from Site settings › Tracking in Statsy (it starts with ws_) and save.
4. Open your site in a private window. The visit appears in Statsy's Live view within seconds.
5. Saving clears popular caching plugins for you. If you use a CDN such as Cloudflare, clear it once.

To send WooCommerce revenue, create a site token under Site settings › API tokens in Statsy and paste it into the Revenue API token field.

== Frequently Asked Questions ==

= Do I need a cookie banner? =

In cookieless mode Statsy stores nothing in the visitor's browser and keeps no IP address, which is the setup most sites use to measure EU visitors without an analytics banner. Rules differ by country, and you remain responsible for your own notices.

= Will ad blockers hide my visitors? =

Some block statsy.co. Set up a first-party domain in Statsy, then enter it under Advanced › Script host, and the script loads from your own domain.

= Does it slow my site down? =

The script is about 2 KB, loads with defer, and never blocks rendering.

= Where are my own visits? =

Administrators and editors are not counted by default. Change that under Do not track.

= Can I change the tag? =

Use the `statsy_script_attributes` filter to add or change attributes, and `statsy_should_track` to skip the tag on any request.

== Changelog ==

= 1.1.0 =
* Saving settings clears page caches automatically: WP Rocket, W3 Total Cache, LiteSpeed, WP Super Cache, WP Fastest Cache, SiteGround, Autoptimize, Cache Enabler, Breeze, Hummingbird, Nginx Helper, WP Engine and Kinsta.
* New status panel: checks the website key, that the tag is live on your homepage, and that data is arriving.
* Clear cache now and Check again buttons, and a redesigned settings page.

= 1.0.1 =
* Fix: saving the settings page failed with "options page is not in the allowed options list".

= 1.0.0 =
* First release: tracking tag, role exclusions, automatic captures, identify for signed-in users, WooCommerce purchase goal and server-side revenue.
