=== UTM Tracker for Gravity Forms ===
Contributors: auxanoglobalservices14
Tags: gravity forms, utm, utm tracking, campaigns, analytics
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Track UTM parameters, ad click IDs, and session data. Auto-fill Gravity Forms fields with configurable cookie storage.

== Description ==
UTM Tracker for Gravity Forms is a lightweight marketing attribution plugin for Gravity Forms. It captures UTM parameters, advertising click IDs, custom URL parameters, and optional session data — then stores them in browser cookies and auto-fills matching Gravity Forms hidden fields.

**Version 2.0 highlights:**

* Track standard UTMs plus gclid, fbclid, msclkid, and more
* Add custom URL parameters without code changes
* First-touch or last-touch attribution models
* Automatic hidden field mapping by parameter name
* Landing page, referrer, device, and session tracking
* Debug panel and cookie manager for testing
* Built-in UTM URL builder
* JavaScript API, shortcodes, and REST API
* Export / import settings as JSON
* Developer hooks for easy extension

Configure everything under **Settings → UTM Tracker** in your WordPress admin.

== Features ==
* Standard UTM tracking: source, medium, campaign, term, content, id
* Advertising click IDs: gclid, gbraid, wbraid, fbclid, msclkid, ttclid, li_fat_id, twclid
* Custom URL parameter tracking (affiliate, coupon, ref, etc.)
* Configurable cookie duration (presets or custom 1–3650 days)
* First-touch and last-touch attribution models
* Automatic Gravity Forms hidden field population
* Landing page and referrer tracking
* Device type, OS, and browser tracking
* Visit date, time, timezone, and session ID
* Admin debug panel and cookie manager
* Built-in UTM URL builder with copy button
* JavaScript API: `UTMTracker.get()`, `getAll()`, `has()`, `clear()`
* Shortcodes: `[utm_source]`, `[gclid]`, `[referrer]`, and more
* REST API: `/wp-json/utm-tracker/v1/current`
* Export / import settings as JSON
* Developer hooks and filters
* No jQuery dependency on the frontend
* Works with AJAX, multi-step forms, and cached sites

== Installation ==
1. Upload and activate the plugin.
2. Ensure **Gravity Forms** is installed and active.
3. Go to **Settings → UTM Tracker** to configure cookie duration, attribution, and tracking options.
4. In Gravity Forms, add hidden fields with dynamic population parameter names (e.g. `utm_source`, `gclid`).
5. Enable **Allow field to be populated dynamically** on each field.
6. Test with a URL like `?utm_source=google&utm_medium=cpc&utm_campaign=test`.

== Frequently Asked Questions ==

= Does the field label matter? =
No. The **Parameter Name** must match the tracking key (e.g. `utm_source`). The field label can be anything.

= Can I add custom tracking parameters? =
Yes. Add them one per line under **Settings → UTM Tracker → Custom Parameters**.

= How do I test tracking? =
Use **Settings → UTM Tracker Debug** or append `?utgf_debug=1` to any page URL while logged in as an administrator.

= How do I clear cookies during testing? =
Use **Settings → UTM Tracker Cookies** or append `?utgf_cookie_manager=1` to any page URL.

= What is the difference between first-touch and last-touch? =
**Last Touch** replaces cookies when new values arrive. **First Touch** keeps the original value only.

= Is there a developer API? =
Yes. Use `UTMTracker.get('utm_source')`, filters like `utm_tracker_parameters`, and the REST endpoint `/wp-json/utm-tracker/v1/current`.

== Screenshots ==

1. Gravity Forms hidden UTM fields with dynamic population enabled.
2. UTM cookies stored in the browser.
3. UTM Tracker settings page under Settings.
4. Frontend debug panel for administrators.
5. UTM URL builder in the admin.

== Upgrade Notice ==
= 2.1.0 =
Refreshed user interface, enqueued Lucide Icons library, added brand logo, and resolved page access permissions.

= 2.0.0 =
Major update: expanded parameter tracking, attribution models, debug tools, URL builder, REST API, shortcodes, and export/import settings.

= 1.1.0 =
Added configurable cookie duration and settings page.

= 1.0 =
Initial release.

== Changelog ==
= 2.1.0 =
* Migrated legacy WordPress Dashicons to crisp, dynamic Lucide Icons enqueued globally
* Redesigned horizontal tabs navigation to a modern segmented pill layout inspired by modern Gravity Forms UI
* Displayed custom brand logo GIF in the layout dashboard header
* Fixed double quote template print markup leak typo in Campaign Source tooltip trigger on URL Builder page
* Fixed readyState check boot initialization callback parentheses execution bug in JavaScript
* Resolved persistent skeleton loading overlays rendering on top of loaded cookie lists and debug drawers
* Redesigned primary, secondary, and danger button styles to modern SaaS layouts with smooth focus rings
* Standardized form field dropdown height and padding parameters to prevent text clipping

= 2.0.0 =
* Added support for utm_term, utm_content, utm_id, and major ad click IDs
* Added custom URL parameter tracking
* Added first-touch and last-touch attribution models
* Added automatic hidden field mapping improvements
* Added landing page, referrer, device, and session tracking
* Added debug panel and frontend cookie manager
* Added UTM URL builder admin tool
* Added JavaScript API, shortcodes, and REST API
* Added export / import settings as JSON
* Added developer hooks and filters
* Rebuilt plugin with namespaced OOP architecture
* Removed jQuery dependency from frontend tracker
* Added custom cookie duration (1–3650 days)

= 1.1.0 =
* Added admin settings page under Settings → UTM Tracker
* Added configurable cookie duration presets

= 1.0 =
* Initial release.
