=== UCPify Agent Detector ===
Contributors: ucpify
Tags: ai, chatgpt, bots, analytics, artificial intelligence
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Detect and log AI Agent visits (ChatGPT, Claude, Gemini, etc.) to your WordPress site and report them to UCPify.net.

== Description ==

UCPify Agent Detector is a lightweight plugin designed to help store owners understand how AI Shopping Agents interact with their website. As the web transitions to an AI-first search and shopping experience, knowing which agents (like OpenAI's GPTBot, Anthropic's ClaudeBot, or Googlebot) are visiting your site is crucial.

This plugin provides real-time analytics by connecting to the UCPify.net dashboard, allowing you to monitor AI traffic and behavior.

= Key Features =

* **AI Agent Tracking:** Detects visits from ChatGPT, Claude, Gemini Pro, Perplexity AI, Brave Leo, and Apple Intelligence.
* **Server-side Detection:** Captures AI crawlers even if they do not execute JavaScript.
* **Dashboard Integration:** View detailed reports and trends in your UCPify.net account.
* **Tracking Consent Switch:** Enable or disable all data collection directly from the plugin settings page.

= Privacy & Data Collection =

This plugin is designed to track AI agent bots, not human users. When enabled, it sends the following anonymous technical data to the UCPify.net API:

* **User Agent string** (to identify the AI bot type)
* **Domain** (your site's hostname)
* **URL Path** (the page being visited)
* **Your API Key** (to associate data with your account)

No personal data, cookies, IP addresses of human visitors, or any identifying information is stored or transmitted. You can disable all tracking at any time from the plugin settings page.

**Note:** This plugin requires a free or premium account at [UCPify.net](https://ucpify.net) to view analytics.

== Installation ==

1. Upload the `ucpify-agent-detector` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to **Settings > UCPify** in your WordPress admin.
4. Enter your **API Key** from your UCPify.net dashboard.
5. Ensure **AI Agent Tracking** is enabled and click Save Changes.

== Frequently Asked Questions ==

= Does this plugin slow down my site? =

No. The tracking script is tiny and runs asynchronously. Server-side detection uses non-blocking requests to ensure no impact on page load times.

= Where do I find my API Key? =

Log in to your dashboard at [UCPify.net](https://ucpify.net/dashboard), click on your store, and find the API Key under the "Settings" tab.

= Does this plugin collect personal data from my visitors? =

No. The plugin only detects AI bot User Agents (e.g., GPTBot, ClaudeBot) and sends the URL path and domain where the bot visited. It does not collect or transmit any human visitor personal data.

= Can I stop all data collection? =

Yes. Uncheck the "AI Agent Tracking" checkbox on the Settings page and save. This immediately disables both the JavaScript tracker and the server-side bot detector.

= Is this plugin compatible with GDPR / privacy regulations? =

The plugin tracks AI bots, not human users, so standard GDPR consent requirements for personal data do not apply. However, we provide a tracking consent toggle so you have full control over when data is sent.

== Screenshots ==

1. The UCPify Settings page in WordPress admin showing the API Key and tracking consent toggle.
2. Example of the AI Agent analytics dashboard at UCPify.net.

== Changelog ==

= 1.2.1 =
* Fixed: Resolved 404 error for Plugin URI on ucpify.net - landing page is now live.
* Updated: Support information and plugin documentation.

= 1.2.0 =
* Added: "AI Agent Tracking" consent toggle — enable/disable all data collection from settings.
* Added: Privacy disclosure panel on settings page explaining what data is sent.
* Fixed: User-Agent string is now properly sanitized before use (WordPress coding standards).
* Fixed: JavaScript tracker now uses `window.location.host` (includes port) for better localhost compatibility.
* Fixed: Added `negotiate` path keyword detection for Price Negotiation funnel events.
* Fixed: Added `ucp.json` path detection for UCP Profile Read events.
* Fixed: Added `cart` path detection for Checkout Attempt events.
* Updated: Tested up to WordPress 6.7.
* Updated: Version bumped to 1.2.0.

= 1.1.0 =
* Removed UCP Discovery features to focus on core Analytics.
* Added server-side fallback detection for non-JS bots.
* Improved security with nonces and sanitization.

= 1.0.0 =
* Initial release with basic AI agent detection via JavaScript.

== Upgrade Notice ==

= 1.2.1 =
Fixed 404 error. This version includes updated support info.

= 1.2.0 =
This version adds a tracking consent toggle and improves GDPR transparency. After upgrading, review the settings page to confirm your tracking preferences.
