=== Leapio ===
Contributors: leapio
Tags: analytics, b2b, attribution, woocommerce, consent
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Go-to-market analytics that drive revenue and action, not just insights. Add Leapio to WordPress from one settings page, with no theme edits.

== Description ==

Leapio is analytics for go-to-market teams. One first-party snippet measures every event in real time, connects activity to known users and companies, enriches accounts, and surfaces the signals worth acting on, closing the loop from measurement to action.

This plugin adds the Leapio snippet to your WordPress site and lets you configure it from **Settings > Leapio Analytics**, so you don't need to edit your theme or install a header-scripts plugin. The analysis, signals, and actions happen in your Leapio account.

**Features**

* One-field install: paste your public key and Leapio starts measuring pageviews in real time.
* Snippet loading: `async` (recommended) or `defer`.
* Role exclusion: administrators are excluded by default, with optional measurement inside wp-admin.
* Autocapture controls: outbound links, file downloads, form submissions, element clicks, and input changes, each deferring to your Leapio dashboard by default. Autocapture never records typed values or sensitive inputs.
* URL privacy: strip query parameters from tracked URLs, with a configurable allow-list.
* Consent: mirror your existing cookie banner by choosing a consent source (Concord, OneTrust, Usercentrics, Cookiebot, or Google Consent Mode) and a consent behavior. Consent is enforced server-side and recorded on every event, and visitors can opt out with `?dnt` on any URL.
* Logged-in user identification (optional, off by default): Pseudonymized mode sends a salted hash; Full mode sends a raw identifier plus the traits you select. The plugin calls Leapio's `identify()` for logged-in users and `reset()` on logout, so a visitor's anonymous and signed-in sessions join one identity.
* WooCommerce revenue (optional): send a revenue event for each paid order from the order-received page (order total and currency, no personal data), so purchases attribute back to the visits that produced them.
* Debug tab: preview the exact snippet and identify payload before going live.
* Clean uninstall, multisite-aware.

== Installation ==

1. In WordPress, go to **Plugins > Add New**, search for "Leapio", and click **Install Now**. Or upload the plugin to `/wp-content/plugins/leapio`.
2. Activate the plugin.
3. Go to **Settings > Leapio Analytics**.
4. Paste your Leapio public key (it starts with `pk_`) and click **Save Changes**.
5. Visit your site, then open Leapio: pageviews appear in the real-time feed within seconds.

== Frequently Asked Questions ==

= Do I need a Leapio account? =
Yes. The plugin is free, and Leapio has a free plan with no credit card required. Start free at https://www.leapio.com and see plans at https://www.leapio.com/pricing.

= Where do I find my public key? =
In your Leapio dashboard, on the project install/tracking screen. Copy the value that starts with `pk_`. You can also paste the whole `<script>` snippet and the plugin will extract the key.

= Does it track logged-in administrators? =
No. Administrators are excluded by default. You can change which roles are excluded on the Tracking tab.

= Does it work with WooCommerce? =
Yes. Turn on **WooCommerce Revenue** on the Tracking tab. Each paid order sends one revenue event from the order-received page, and refreshing that page does not send it again.

= Is identification GDPR compliant? =
Identification is off by default. Enable it only with a lawful basis and appropriate disclosure. Pseudonymized mode avoids sending raw personal data.

= Does the plugin respect consent? =
Yes. Leapio records consent on every event and enforces it server-side, regardless of plugin settings. You can mirror your cookie banner with the Privacy & Consent settings, and visitors can opt out at any time by adding `?dnt` to a URL.

== External services ==

This plugin connects your site to the Leapio analytics service:

* It loads the Leapio snippet from `https://cdn.leapio.com/lp.js`.
* The snippet sends analytics events (such as pageviews and, if enabled, identify calls) to Leapio's API at `https://api.leapio.com`.

Data is sent only from visitors' browsers when they load pages on your site. When WooCommerce Revenue is enabled, the order total, currency, order ID, item count, and payment method are also sent from the order-received page.

* Terms of service: https://www.leapio.com/legal/saas-agreement
* Privacy policy: https://www.leapio.com/legal/website-privacy-policy

== Screenshots ==

1. AI-native go-to-market analytics: drive revenue and action, not just insights.
2. Measure: see every visit and the companies behind them.
3. Identify & enrich: the company behind the visit.
4. Revenue attribution: which channels actually pay.
5. Signals: spot buying signals and act before anyone else.
6. Actions: act across your entire go-to-market stack.
7. The Tracking settings tab.
8. The Privacy & Consent tab.
9. The Debug tab showing the injected snippet preview.

== Changelog ==

= 1.0.0 =
* First release of Leapio for WordPress.
* Add Leapio from Settings > Leapio Analytics by pasting your public key. No theme edits.
* Choose async or defer loading, and leave out administrators or other roles.
* Turn autocapture on or off for links, downloads, forms, clicks, and input changes.
* Mirror your cookie banner (Concord, OneTrust, Usercentrics, Cookiebot, or Google Consent Mode).
* Optionally identify logged-in users, either pseudonymized or in full.
* Optionally send WooCommerce revenue, once per paid order.
* Preview the exact snippet on the Debug tab before going live.
