=== OneLence Connect for WordPress ===
Contributors: crelora
Tags: marketing, attribution, analytics, growth, affiliates
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.2.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WordPress to OneLence for reliable attribution, cleaner marketing signals, and clearer decisions about what deserves more investment.

== Description ==

[OneLence](https://onelence.com) is a marketing decision layer that helps teams understand which channels, campaigns, creators, affiliates, and customer journeys actually contribute to growth—so decisions are based on evidence, not guesswork.

**OneLence Connect** is the official WordPress integration for the OneLence platform. It sends reliable server-side attribution and conversion data from your WordPress site into your OneLence workspace, including WooCommerce activity, with less data loss from ad blockers and browser restrictions.

Once connected, your WordPress data becomes part of the broader OneLence decision workflow: attribution, channel evaluation, conversion analysis, reinvestment decisions, and growth prioritization.

This plugin is focused on reliable data collection and delivery for OneLence. Reporting, decision workflows, and strategic insights happen inside your OneLence workspace.

**What you get**

* **More reliable attribution** with server-side tracking and reduced data loss
* **WooCommerce conversion tracking** with automatic retry handling when delivery fails
* **Consent-aware tracking** compatible with popular CMPs and OneLence Consent
* **Hybrid tracking mode** that combines server reliability with browser SDK capabilities without duplicate page views
* **No-code event setup** using the Events tab with visual selectors and rule builders
* **Diagnostics and validation tools** in wp-admin, including Test Connection before launch
* **Reliable inputs for OneLence decisions** about channels, campaigns, creators, affiliates, and growth priorities

**What you need**

* A [OneLence account](https://onelence.com) ([free trial available](https://onelence.com/pricing))
* Use **Connect to OneLence** in the plugin dashboard—your site is linked and credentials are configured automatically

Works on any WordPress site, including WooCommerce stores, SaaS sites, landing pages, content-driven brands, and lead-generation websites.

WooCommerce support is optional but fully supported for order and conversion tracking.

**Learn more**

* [OneLence — marketing decision layer](https://onelence.com)
* [WordPress setup guide](https://onelence.com/docs/integrations/start-integration/website-builder-setup/wordpress)
* [Integrations overview](https://onelence.com/docs/integrations/start-integration)

== Installation ==

1. Install and activate **OneLence Connect for WordPress** from the WordPress Plugins screen (or upload the plugin folder to `/wp-content/plugins/onelence-connect/`).
2. In wp-admin, open **OneLence**.
3. Click **Connect to OneLence** and sign in (or complete setup in your OneLence workspace).
4. Review Tracking and Store settings, then run **Test Connection** on the dashboard.

== External services ==

This plugin connects to external services. Data is only sent when tracking is enabled and your consent settings allow it.

= OneLence ingestion API =

Used to deliver server-side attribution events and WooCommerce conversions to your OneLence workspace.

* **What is sent:** page URLs, visitor identifiers (`olm_vid`), UTM and attribution parameters, event names and configured properties, WooCommerce order metadata when store tracking is enabled, and optional user email on login for identify events.
* **When:** on page views, configured events, conversions, and related server-side actions according to your tracking mode and consent mode.
* **Where:** `https://ingest.onelence.com`
* **Provider:** Crelora / OneLence — [Terms of Service](https://onelence.com/terms-of-service), [Privacy Policy](https://onelence.com/privacy-policy)

= Mark browser SDK (Hybrid / JS-only modes) =

Used for client-side tracking when Hybrid or JS-only tracking modes are enabled.

* **What is sent:** analytics and attribution data configured in the plugin, including page views and custom events, subject to your CMP and consent settings.
* **When:** after consent is granted (or immediately when no CMP is detected and your consent mode allows it).
* **Where:** the Mark SDK bundled inside this plugin (`assets/js/mark.browser.umd.js`). No third-party script host is used on WordPress.org builds.
* **Provider:** Crelora / OneLence — [Terms of Service](https://onelence.com/terms-of-service), [Privacy Policy](https://onelence.com/privacy-policy)

= Connect to OneLence (setup) =

Used when an administrator clicks **Connect to OneLence** in wp-admin to link the WordPress site to a OneLence workspace.

* **What is sent:** OAuth/session tokens and site metadata required to obtain API credentials.
* **When:** during the administrator-initiated connect flow.
* **Where:** OneLence web properties under `onelence.com`
* **Provider:** Crelora / OneLence — [Terms of Service](https://onelence.com/terms-of-service), [Privacy Policy](https://onelence.com/privacy-policy)

= OneLence Consent (optional separate plugin) =

Not required. If installed, OneLence Connect reads consent signals from that plugin and may forward optional coverage metrics when forwarding is enabled in settings.

* **What is sent:** consent state required for tracking decisions and optional lightweight coverage metrics when forwarding is enabled.
* **When:** while visitors interact with the consent banner and when forwarding is enabled.
* **Where:** local WordPress installation (OneLence Consent plugin). Download: [onelence.com/consent/download](https://onelence.com/consent/download)
* **Provider:** Crelora / OneLence — [Terms of Service](https://onelence.com/terms-of-service), [Privacy Policy](https://onelence.com/privacy-policy)

== Privacy ==

* **Cookies:** `olm_vid` (visitor identity) and `olm_utm` (attribution parameters). These are set according to your consent mode and detected CMP.
* **Consent:** OneLence Connect reads consent signals from your CMP; it does not replace your cookie banner. Optional **OneLence Consent** is available as a separate plugin.
* **WordPress tools:** Personal data export is registered with WordPress privacy tools. Use **Keep Data on Uninstall** in Tracking settings if you want plugin options retained after uninstall.
* **Policy:** [OneLence privacy policy](https://onelence.com/privacy-policy)

== Frequently Asked Questions ==

= What is OneLence? =

OneLence is a marketing decision layer for teams that want to scale using evidence instead of fragmented analytics and surface-level metrics.

It combines attribution, conversions, behavior, and channel performance into a clearer view of what is actually driving growth—helping teams decide what deserves more investment, what underperforms, and where growth opportunities exist.

OneLence Connect is the WordPress integration that sends your site and WooCommerce data into that workflow.

Learn more at [onelence.com](https://onelence.com).

= Do I need WooCommerce? =

No. Page views and custom events work on any WordPress site. WooCommerce features are only needed for stores and order tracking.

= What are Relaxed and Strict consent modes? =

**Relaxed** allows limited server-side activity before consent while delaying cookies and browser SDK loading until consent is granted.

**Strict** blocks all tracking activity (server-side and browser-side) until consent is granted.

= Will Hybrid mode create duplicate page views? =

No. Hybrid mode uses the browser SDK for page view tracking and prevents duplicate server-side page view emission.

= What happens if a WooCommerce conversion fails to send? =

The order is not marked as tracked until OneLence confirms successful delivery. Failed sends are retried automatically.

= How do I verify my setup? =

Use **Test Connection** on the dashboard. The plugin will also warn you if the registered site host does not match your current WordPress site.

= Can I track custom events without code? =

Yes. The **Events** tab includes visual selectors and rule builders for clicks, form submissions, and thank-you page visits.

Conversions always require explicit conversion rules.

= Is OneLence Consent required? =

No. OneLence Connect works with existing CMPs and consent platforms.

OneLence Consent is optional for teams that want a OneLence-native consent banner and coverage insights.

= Can I keep plugin settings after uninstalling? =

Yes. Enable **Keep Data on Uninstall** in the Tracking tab before removing the plugin.

== Screenshots ==

1. Dashboard with connection status and Test Connection
2. Connect tab — link your OneLence account
3. Tracking tab — tracking modes and diagnostics
4. Store tab — WooCommerce conversion settings
5. Privacy & Coverage — consent handling and CMP detection

== For developers ==

OneLence Connect exposes WordPress hooks for custom integrations, including:

* `onelco_should_track`
* `onelco_event_payload`
* `onelco_conversion_payload`
* `onelco_visitor_id`
* `onelco_event_sent`
* `onelco_conversion_sent`
* `onelco_load_mark_sdk`

Custom conversions can use:

* `ONELCO_Tracker::track_custom_conversion()`
* `onelco_track_custom_conversion` action

Full integration reference:

[WordPress setup docs](https://onelence.com/docs/integrations/start-integration/website-builder-setup/wordpress)

== Changelog ==

= 1.2.4 =
* Plugin display name updated to OneLence Connect for WordPress (slug remains `onelence-connect`).
* Tested up to WordPress 7.0.

= 1.2.3 =
* WordPress.org review: Mark SDK bundled locally and enqueued via `wp_enqueue_script` (no jsDelivr on directory builds).
* Directory build excludes CDN-only npm registry checks and remote Consent install/activate; Consent installation is manual download + activation only.
* Expanded External services documentation in readme.
* Plugin URI points to public WordPress setup documentation.

= 1.2.1 =
* WordPress.org review: enqueue Mark SDK via `wp_enqueue_script`; bundle SDK locally.
* WordPress.org build: no remote Consent plugin install; manual download + activate only.
* Plugin URI points to the public WordPress setup documentation.
* Expanded External services documentation in readme.

= 1.2.0 =
* WordPress.org distribution build with directory-ready packaging and readme.
* Dual release channels: WordPress.org updates via the plugin directory; CDN builds keep in-dashboard updates.
* Consent tab on WordPress.org builds links to OneLence Consent download instead of remote install.
* Updated compatibility headers (PHP 8.0+, WordPress 6.8 tested).
* Default Mark SDK version 0.2.1.

= 1.1.0 =
* In-dashboard plugin updates from CDN release manifest.
* First-class support for OneLence Consent CMP.
* Events tab with visual selector and rule builder.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.2.4 =
Display name is now OneLence Connect for WordPress. Tested with WordPress 7.0. Recommended for all sites on 1.2.3 or earlier.
