=== Pierview Agent Analytics ===
Contributors: kensonpierview
Tags: analytics, ai, bot, agent, tracking
Requires at least: 5.9
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.7
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

See which AI agents are reading your content — ChatGPT, Claude, Perplexity, Gemini, and more — tracked in real time via the Pierview dashboard.

== Description ==

AI assistants like ChatGPT, Claude, Perplexity, and Gemini crawl websites to generate answers for their users. Pierview Agent Analytics detects these visits and reports them to your [Pierview](https://www.pierview.ai/) dashboard, giving you visibility into which AI systems are reading your content, how often, and which pages they visit.

Read more at [pierview.ai](https://www.pierview.ai/).

= Key Features =

* Named bot identification: distinguishes between 25+ AI agents including ChatGPT, Claude, Perplexity, Gemini, Grok, Bing, and more
* Zero performance impact: detection and reporting use a non-blocking background request that adds no latency to page loads
* Privacy controls: redact sensitive query parameters and exclude specific URL path prefixes from being tracked
* No database tables: lightweight footprint, clean uninstall
* Test connection: verify your API key and endpoint are working from the settings page
* Enable/disable without deactivating: pause tracking at any time from the General settings tab

= How It Works =

1. On each front-end request, the plugin reads the incoming User-Agent header
2. It checks the User-Agent against a list of 25+ known AI agent patterns
3. If a match is found, a non-blocking HTTP POST is sent to the Pierview platform in the background
4. The event appears in your Pierview dashboard with agent name, page path, and timestamp
5. Regular human visitors and WordPress admin traffic are never tracked

= Supported AI Agents =

* ChatGPT / OpenAI: GPTBot, ChatGPT-User, OAI-SearchBot
* Claude / Anthropic: ClaudeBot, Claude-User, Claude-SearchBot, anthropic-ai
* Perplexity: PerplexityBot, Perplexity-User
* Gemini / Google: Google-Extended, Google-CloudVertexBot, GoogleAgent-Mariner
* Grok / xAI: GrokBot, xAI-Grok, Grok-DeepSearch
* Microsoft Bing: Bingbot
* Apple: Applebot, Applebot-Extended
* Meta: FacebookBot
* Amazon: Amazonbot
* DuckDuckGo: DuckAssistBot
* Plus: Cohere, Mistral, DeepSeek, You.com, ByteDance, Phind, Diffbot, and more

= Privacy & Security =

* AI traffic only: only requests from known AI agent User-Agents are reported, regular visitors are never tracked
* Admin traffic excluded: wp-admin, wp-login.php, REST API, and feed requests are always skipped
* Query parameter redaction: strip sensitive parameters (e.g. `token`, `session_id`) from paths before they leave your server
* Path exclusions: exclude entire sections of your site (e.g. `/checkout/`, `/members/`) from tracking
* Nonce-protected admin: all admin actions use WordPress nonces and capability checks
* No client-side tracking: server-side only, no cookies, no JavaScript injected into your pages

== Installation ==

1. Download the plugin zip from the [Pierview website](https://www.pierview.ai/)
1. In your WordPress admin go to **Plugins > Add New > Upload Plugin**
1. Upload the zip file and click **Install Now**
1. Activate the plugin
1. Go to **Settings > Pierview Analytics** and enter your API key
1. Click **Send Test Event** to confirm the connection is working

== Frequently Asked Questions ==

= Do I need a Pierview account? =

Yes. You need a [Pierview](https://www.pierview.ai/) account and API key. The plugin sends tracking events to Pierview where you can view your analytics dashboard.

= Will this slow down my site? =

No. The plugin fires a non-blocking HTTP POST in the background only when an AI bot is detected. Page delivery is never delayed.

= Does this track regular human visitors? =

No. The plugin only records visits from known AI agent User-Agents. Regular browser traffic, WordPress admin activity, REST API calls, and login page requests are all ignored.

= What data is sent to Pierview? =

Each event includes: the matched agent name, bot User-Agent string, your site's hostname, the request path, HTTP method, referer header, visitor IP address, and a UTC timestamp. No page content or WordPress user data is ever collected.

= How do I exclude certain pages from tracking? =

Go to **Settings > Pierview Analytics > Privacy** and add path prefixes to the "Exclude Path Prefixes" field. For example, adding `/members/` will skip all URLs under that path.

= Can I redact sensitive query parameters? =

Yes. Go to **Settings > Pierview Analytics > Privacy** and add parameter names (one per line) to the "Redact Query Parameters" field. Those parameters will be stripped from the path before the event is sent to Pierview.

= How do I disable tracking temporarily? =

Uncheck **Enable Tracking** on the General settings tab. No events will be sent until you re-enable it. You do not need to deactivate the plugin.

= What happens if the Pierview API is unavailable? =

The tracking request uses a non-blocking fire-and-forget POST. If the endpoint is unreachable, the request times out silently with no impact on your site.

= How do I verify my API key is working? =

Click **Send Test Event** on the General settings tab. The plugin will send a test payload to the configured endpoint and report the HTTP response status.

== External Services ==

This plugin transmits data to the Pierview analytics service when a known AI agent bot is detected visiting your site. No data is sent for regular human visitors.

The following data is sent on each detected bot visit: the bot's User-Agent string, normalized agent name, your site's hostname, the request path, HTTP method, HTTP referer header, the visitor's IP address, and a UTC timestamp.

Data is only transmitted when:
* The plugin is enabled (via the "Enable Tracking" setting)
* A request matches a known AI agent User-Agent pattern
* A valid API key is configured

Service provider: [Pierview](https://www.pierview.ai/)
Terms of Service: https://pierview.ai/legal/terms
Privacy Policy: https://pierview.ai/legal/privacy
Data Processing Agreement: https://pierview.ai/legal/dpa

== Changelog ==

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.0.0 =
Initial release.
