=== DR Lead Tracking ===
Contributors: digitalrebelz
Tags: leads, marketing, google ads, meta ads, lead tracking, attribution, multi-touch, contact form 7, elementor, gravity forms, wpforms
Requires at least: 5.0
Tested up to: 6.7
Stable tag: 3.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

== Description ==

Connect your WordPress forms directly to the Digital Rebelz Lead Portal for advanced multi-touch attribution and lead qualification. This plugin tracks the full visitor journey (all touchpoints) and securely transmits form data to the Digital Rebelz platform.

**Key features:**

* **Multi-touch attribution** — See the full visitor path: which channels, campaigns, and search terms led to a conversion
* **Automatic lead sync** — Leads are forwarded instantly, no manual integration needed
* **Universal form support** — Works with Contact Form 7, Elementor Pro, Gravity Forms, WPForms, Ninja Forms, Formidable Forms, Fluent Forms, and Forminator
* **SST cookie support** — Reads Google Ads (_gcl_aw) and Meta Ads (_fbc) first-party cookies for reliable attribution
* **Zero performance impact** — Asynchronous, non-blocking, no delay for visitors

**Important:** This plugin connects to the external service of Digital Rebelz. An active Digital Rebelz account and a valid API key are required. The plugin does not transmit any data until a valid API key has been entered in the settings.

== External Service ==

This plugin relies on a 3rd party service provided by Digital Rebelz B.V. (https://digitalrebelz.com).

When activated, the plugin transmits form submission data and marketing attribution data (UTM parameters, click IDs) to the Digital Rebelz Lead Portal at https://portal.digitalrebelz.com.

**No data is transmitted until the site administrator enters a valid API key in the plugin settings.** API keys are generated per client in the Digital Rebelz Lead Portal.

Data transmitted includes:
* Form field values submitted by visitors (name, email, phone, message)
* Marketing attribution parameters (UTM tags, gclid, fbclid)
* Visitor touchpoint journey (which pages and sources led to the conversion)
* The website domain name

Data is NOT transmitted for:
* Logged-in WordPress administrators
* Form submissions before a valid API key is configured

Please review our Privacy Policy: https://digitalrebelz.com/privacy
And our Terms of Service: https://digitalrebelz.com/terms

== Installation ==

1. Upload the `dr-lead-tracking` folder to the `/wp-content/plugins/` directory, or install the ZIP file via the WordPress dashboard (Plugins > Add New > Upload).
2. Activate the plugin through the 'Plugins' screen.
3. Go to 'Settings' > 'DR Lead Tracking'.
4. Enter the API key you received from Digital Rebelz.
5. Optional: adjust the API URL if you use a custom server.

== Frequently Asked Questions ==

= Is any data sent without configuration? =
No. The plugin only transmits data after a valid API key has been entered in the settings screen. Without a valid API key, no data is sent to external servers.

= What data is transmitted? =
The plugin sends the fields submitted by the visitor in the form (name, email, phone, message), along with marketing parameters (UTM tags, gclid, fbclid) for attribution tracking.

= Are WordPress administrators tracked? =
No. Logged-in administrators are automatically excluded from tracking.

= Does the plugin affect page load speed? =
No. The JavaScript is loaded asynchronously (defer) and API calls are non-blocking. The form always works normally, regardless of whether the API is reachable.

= What happens if the API is unreachable? =
The form continues to work normally. Undelivered leads are stored in a local queue and automatically retried via WP-Cron (every 5 minutes, up to 10 attempts).

= Which form plugins are supported? =
Contact Form 7 (+ Flamingo), Elementor Pro Forms, Gravity Forms, WPForms, Ninja Forms, Formidable Forms, Fluent Forms, and Forminator.

= Can I view error logs? =
Yes. Go to Settings > DR Lead Tracking to see the queue status. Detailed logs are available at wp-content/uploads/dr-lead-tracking/debug.log.

== Changelog ==

= 3.0.0 =
* Multi-touch attribution: full visitor journey tracking via localStorage
* Automatic lead sync to Digital Rebelz API (no WordPress REST API integration needed)
* Backup queue with automatic retry via WP-Cron
* Support for 8 form plugins
* Admin settings page with connection status
* Explicit opt-in required (valid API key must be entered)
* Administrators are not tracked
* Error logging to wp-content/uploads/dr-lead-tracking/debug.log

= 2.0.0 =
* Universal form support (CF7, Elementor, Gravity, WPForms, Ninja, Formidable, Fluent)
* SST cookie support (_gcl_aw, _fbc)

= 1.0.0 =
* Initial release with CF7/Flamingo support
* Hidden field injection for gclid/fbclid/UTM tracking

== Upgrade Notice ==

= 3.0.0 =
Major update: multi-touch attribution and automatic lead sync. After updating, a valid API key must be entered in Settings > DR Lead Tracking.
