=== LeadSource Pro ===
Contributors: forgeonline
Tags: utm tracking, lead source, form tracking, google ads, facebook ads
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Track which ads and campaigns drive your form submissions. Captures UTM parameters and click IDs across 10 form plugins.

== Description ==

**Stop guessing which marketing channels are generating your leads.**

LeadSource Pro automatically captures UTM parameters and advertising platform click IDs from your visitors, persists them through the browsing session, and attaches the traffic source to every form submission — no configuration on your forms required.

Perfect for small businesses and agencies running ads across Google, Meta, LinkedIn, Microsoft, and TikTok who need simple, reliable lead attribution without complex analytics setups.

= How It Works =

1. A visitor clicks your ad or link containing UTM parameters
2. LeadSource Pro captures and stores the traffic source data in a cookie
3. When the visitor submits a form, the traffic source is automatically recorded
4. View all your leads and their sources in a clean WordPress dashboard

= Supported Form Plugins =

Works automatically with the form plugin you already use — no shortcodes or form modifications needed:

* **Contact Form 7**
* **WPForms**
* **Gravity Forms**
* **Ninja Forms**
* **Formidable Forms**
* **Fluent Forms**
* **Elementor Pro Forms**

= What It Tracks =

* **UTM Parameters** — source, medium, campaign, term, and content
* **Ad Platform Click IDs** — Google (gclid), Meta (fbclid), Microsoft (msclkid), LinkedIn (li_fat_id), TikTok (ttclid)
* **Auto-detected Traffic Source** — labelled as Google Ads, Meta Ads, LinkedIn Ads, Microsoft Ads, TikTok Ads, Organic Search, Direct, or Referral
* **Landing Page URL** — the first page the visitor arrived on
* **Referrer** — where the visitor came from (with server-side fallback)

= Dashboard & Reporting =

* Sortable, searchable entries table with a native WordPress look
* Quick stats showing total submissions and top traffic sources
* Colour-coded badges for each platform (Google, Meta, LinkedIn, etc.)
* View full submission details in a modal popup
* Export all entries to CSV with one click

= Free Features =

The free version is fully functional and never expires:

* All UTM and click ID tracking
* All 10 form plugin integrations
* Admin dashboard with search, sort, and quick stats
* CSV export
* 5-step setup wizard with auto form detection
* Stores the latest 10 form entries (rolling)

= Pro Features =

Upgrade to unlock the full experience:

* **Unlimited stored entries** — never lose a lead
* **Per-submission email notifications** — get alerted the moment a form is submitted
* **Monthly summary emails** — traffic source breakdown delivered to your inbox
* **Daily and weekly summaries** — available on Enterprise plan

[Try Pro free for 30 days — no credit card required.](https://checkout.freemius.com/mode/dialog/plugin/24435/plan/41498/)

= Privacy Friendly =

* IP addresses are automatically anonymised (last octet removed)
* No data sent to external servers — everything stays in your WordPress database
* Setup wizard includes recommended privacy policy language
* Configurable conversion window: same session, 1 day, or 7 days

== Installation ==

1. Upload the `leadsource-pro` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Complete the 5-step setup wizard that appears automatically
4. That's it — traffic sources will be captured on your next form submission

The setup wizard will:

* Auto-detect which form plugins you have installed
* Let you choose your notification preferences
* Configure the conversion window
* Offer a free 30-day Pro trial (no credit card needed)

== Frequently Asked Questions ==

= Do I need to modify my forms? =

No. LeadSource Pro hooks into your form plugin automatically. There are no shortcodes to add, no hidden fields to configure, and no form templates to edit.

= Does it work if I don't use UTM parameters? =

Yes. The plugin also detects ad platform click IDs (gclid, fbclid, etc.) and automatically labels the traffic source. Even visitors arriving via organic search or direct traffic are categorised.

= What happens when I reach 10 entries on the free plan? =

The plugin continues tracking normally. When a new entry is recorded, the oldest entry is removed to keep the latest 10. No data is lost while it's in the table — it's a rolling window. Upgrade to Pro for unlimited storage.

= Will it slow down my site? =

No. The frontend script is tiny vanilla JavaScript (no jQuery dependency) that runs once on page load to read URL parameters. There are no external API calls and no impact on page load speed.

= Does it work with caching plugins? =

Yes. The UTM capture runs in the visitor's browser via JavaScript, so server-side caching does not interfere with tracking.

= What is the conversion window? =

The conversion window controls how long the captured UTM data persists. "Same Session" (recommended) clears it when the browser closes.

= Is my data sent anywhere? =

No. All data is stored locally in your WordPress database. The plugin does not communicate with any external analytics or tracking service.

== Screenshots ==

1. **Dashboard** — View all form submissions with their traffic sources, sortable columns, and quick stats
2. **Entry Detail** — Click any entry to see full UTM parameters, click IDs, landing page, and referrer
3. **Setup Wizard** — 5-step guided setup with automatic form detection
4. **Settings** — Configure email notifications, conversion window, and tracked parameters

== Changelog ==

= 1.0.0 =
* Initial release
* UTM parameter and click ID tracking
* Support for 8 form plugins
* Admin dashboard with WP_List_Table
* 5-step setup wizard
* Freemius integration for Pro licensing
* Email notifications (Pro)
* Summary emails — daily, weekly, monthly (Pro)
* IP anonymisation

== Upgrade Notice ==

= 1.0.0 =
Initial release. Install to start tracking which ads and campaigns are driving your form submissions.
