=== DevLemon UTM Tracker ===
Contributors: devlemon
Tags: utm, campaign tracking, marketing attribution, lead tracking, analytics
Requires at least: 6.2
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

Generate UTM links and track first-touch and last-touch campaign attribution through WordPress lead conversions.

== Description ==

**DevLemon UTM Tracker** is a marketing attribution plugin that captures UTM parameters and click IDs from your traffic, records first-touch and last-touch attribution, and connects that data to form conversions — all without Google Analytics or any external service.

**UTM Builder**
Generate UTM-tagged campaign URLs directly inside WordPress. Presets for Google Ads, Facebook, Instagram, LinkedIn, TikTok, and email. The campaign name normaliser converts "Summer Sale 2026" to "summer_sale_2026".

**First-Touch & Last-Touch Attribution**
Records where a visitor first arrived (utm_source, utm_medium, utm_campaign) and updates the most recent known source on subsequent visits. Direct visits do not overwrite a known last touch by default.

**Click ID Capture**
Captures gclid (Google), gbraid, wbraid, fbclid (Facebook), msclkid (Microsoft), ttclid (TikTok), twclid (Twitter/X), and li_fat_id (LinkedIn) when present in the URL.

**Form Integrations**
Automatically records attribution at the moment of conversion with Contact Form 7 and Elementor Pro Forms. The [devlutmt_fields] shortcode can expose hidden attribution fields in other forms that process WordPress shortcodes; it does not automatically create a conversion record for unsupported form plugins.

**Campaign Reports**
Observe campaigns that arrive from UTM-tagged traffic. No manual creation required. Export to CSV at any time.

**Privacy-conscious design**
Tracking is disabled by default. When enabled by a site administrator, the plugin stores a random first-party visitor identifier together with configured attribution data in the local WordPress database. It does not intentionally store visitor IP addresses or user-agent strings and does not send attribution data to DevLemon or other external services. Depending on your configuration and jurisdiction, UTM parameters, click IDs, and referrer URLs may still be considered personal data, so site owners remain responsible for consent, disclosures, and retention settings.

== Installation ==

1. Upload the `devlemon-utm-tracker` folder to `/wp-content/plugins/`.
2. Activate the plugin.
3. Go to **DevLemon UTM Tracker → Settings** and enable tracking.
4. Generate your first campaign URL with **UTM Builder**.

== Frequently Asked Questions ==

= Does DevLemon UTM Tracker require Google Analytics? =
No. It works completely independently.

= Does it send data to DevLemon? =
No. All data is stored locally in your WordPress database.

= Does it store visitor IP addresses? =
No. DevLemon UTM Tracker never stores IP addresses.

= Can I create UTM URLs? =
Yes. Use the UTM Builder section.

= Does it capture Facebook and Google click IDs? =
Yes, when present in the URL query string.

= Does it track first-touch attribution? =
Yes. The original source is recorded on first visit and never overwritten.

= Does it track last-touch attribution? =
Yes. The most recent attributed source is updated when meaningful new attribution is detected.

= Does it work with Contact Form 7? =
Yes. When CF7 is active, a conversion record with full attribution is saved automatically after a successful form submission.

= Does it use cookies? =
Yes. When tracking is enabled, a first-party cookie (devlutmt_vid) stores only a random visitor identifier. The attribution data itself is stored in the WordPress database.

= Can tracking be disabled? =
Yes. Tracking is disabled by default and can be enabled or disabled at any time in Settings.

= Does this plugin make my site privacy-law compliant? =
No. The plugin provides configurable tracking and retention tools, but site owners are responsible for determining whether consent, notices, or other legal requirements apply to their use case.

== Screenshots ==

1. Marketing Attribution Overview dashboard.
2. Lead attribution records with source type.
3. UTM Builder with presets and campaign name normaliser.
4. Campaign reporting.
5. Attribution settings.
6. Privacy and retention settings.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
