=== Click Counter by Simple Tools ===
Contributors: jimmyredline80
Donate link: https://www.plugins-for-wp.com/
Tags: analytics, click-tracking, conversion, tracking, statistics
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Advanced click tracking for any CSS selector. Analytics, charts, goals, CSV export, visual picker, and more.

== Description ==

**Click Counter by Simple Tools for WP** is a comprehensive click tracking solution that lets you monitor user interactions on any element of your WordPress site using CSS selectors. Track button clicks, link clicks, form submissions, or any other clickable element with detailed analytics and insights.

= Key Features =

**Visual Element Picker**
* Click-to-select any element on your site
* Automatically generates the CSS selector
* No coding knowledge required

**Advanced Analytics**
* View click counts with timestamps
* Track page URLs where clicks occurred
* Filter data by date range
* Visual charts showing click trends over time
* Detailed click logs with full information

**Goal Tracking**
* Set click goals for any tracked element
* Receive email notifications when goals are reached
* Track progress with visual progress bars
* Perfect for conversion tracking

**Data Management**
* Export click data to CSV
* Automatic data retention policies
* Rate limiting to prevent spam
* Bot detection and filtering

**Smart Exclusions**
* Exclude all logged-in users
* Exclude specific user roles (Admin, Editor, etc.)
* Self-ignore mode with cookie-based tracking
* IP-based rate limiting

**Developer Friendly**
* Shortcode support: `[click_count selector=".buy-button"]`
* Clean, efficient code following WordPress standards
* Custom database tables for optimal performance
* Translation ready

= How It Works =

1. **Add a Tracker**: Use the visual picker or enter a CSS selector (like `.buy-button` or `#signup-form`)
2. **Set Goals** (Optional): Define click targets and email notifications
3. **Track Clicks**: The plugin automatically tracks all clicks on matching elements
4. **Analyze Data**: View charts, logs, and export reports
5. **Take Action**: Use insights to optimize your site's performance

= Perfect For =

* **E-commerce**: Track add-to-cart, checkout, and purchase buttons
* **Lead Generation**: Monitor form submissions and signup clicks
* **Content Marketing**: Measure engagement with CTAs and links
* **A/B Testing**: Compare performance of different elements
* **Conversion Optimization**: Identify high-performing buttons and links

= Privacy & Performance =

* No external dependencies for click tracking
* Non-personal site data shared weekly to improve the plugin (see External Services)
* Hashed IP addresses (never stores actual IPs)
* Bot detection prevents false clicks
* Lightweight JavaScript using native browser APIs
* Works with all caching plugins

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/click-counter/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to **Click Counter** in the WordPress admin menu
4. Add your first click tracker using the visual picker or CSS selector
5. Start tracking clicks!

= Quick Start Guide =

1. Navigate to **Click Counter → Click Counter**
2. Click **Add Click Tracker**
3. Use the element picker or enter a CSS selector
4. Give it a friendly name (optional)
5. Set a goal and notification email (optional)
6. Click **Save**
7. Your clicks are now being tracked!

== Frequently Asked Questions ==

= Do I need to know CSS selectors? =

No! The plugin includes a visual element picker. Just click the picker button, click any element on your site, and the selector is automatically generated.

= Will this slow down my site? =

No. The tracking script is tiny (less than 1KB) and uses efficient event delegation. It only loads when you have active trackers and uses the browser's native `sendBeacon` API for non-blocking requests.

= Can I track the same element on multiple pages? =

Yes! The plugin tracks all instances of a selector across your entire site. You can also see which specific pages received clicks in the analytics tab.

= Does it work with caching plugins? =

Yes! The tracking JavaScript works with all caching plugins including WP Rocket, W3 Total Cache, and WP Super Cache.

= Can I exclude my own clicks? =

Yes! Use the "Self Ignore" tab to exclude your clicks via a browser cookie. You can also exclude all logged-in users or specific user roles in Settings.

= How long is click data stored? =

By default, data is kept for 90 days. You can adjust this in Settings or set it to keep data forever.

= Can I export my data? =

Yes! Use the CSV export feature in the Analytics tab to download your click data. You can filter by date range and specific trackers.

= Does it track personal information? =

No. IP addresses are hashed (not stored), user IDs are optional, and no personal data is collected. The plugin is GDPR-friendly.

= What happens when a goal is reached? =

You'll receive an email notification at the address you specified. The notification includes the tracker name, goal count, and current click count.

= Can I reset click counts? =

Yes! You can reset individual trackers or all trackers at once from the Click Counter tab.

== Screenshots ==

1. **Click Counter Tab** - Add, edit, delete trackers with real-time click counts and goal progress
2. **Visual Element Picker** - Click any element on your site to track it
3. **Analytics & Charts** - View click trends, filter by date, and export data
4. **Click Logs** - Detailed logs showing when and where clicks occurred
5. **Goal Tracking** - Set goals and receive email notifications
6. **Settings** - Configure exclusions, data retention, and tracking options
7. **Self Ignore** - Exclude your own clicks from tracking

== External Services ==

This plugin makes connections to external services under specific circumstances:

**1. Site Telemetry (Automatic)**
- **When**: Weekly via WordPress cron, and on plugin activation/deactivation
- **What's sent**: Website URL, domain name, plugin version, estimated monthly pageviews (aggregated, non-personal), average server response speed (milliseconds), and activation/deactivation/update events
- **Where**: `https://plugins-for-wp.com/wp-json/st-telemetry/v1/collect`
- **Why**: To understand plugin usage patterns, ensure compatibility across WordPress versions and hosting environments, improve plugin features, and provide better support
- **User control**: This data collection is a condition of using the plugin. No personally identifiable visitor data, IP addresses, or individual click-level tracking data from your site visitors is transmitted.

**2. Deactivation Feedback (Optional)**
- **When**: Only when you deactivate the plugin and choose to submit feedback
- **What's sent**: Plugin slug, site URL, reason for deactivation (selected from predefined options), optional user comments, WordPress version, PHP version, and plugin version
- **Where**: `https://plugins-for-wp.com/wp-json/st-feedback/v1/submit`
- **Why**: To help us improve the plugin based on user feedback
- **User control**: Completely optional - you can click "Cancel" or simply close the feedback dialog without submitting anything

**External Service Policies:**
- Terms of Service: https://www.plugins-for-wp.com/terms-and-conditions/
- Privacy Policy: https://www.plugins-for-wp.com/privacy-policy/

== Privacy ==

**What This Plugin Does NOT Do:**
- Does not store actual IP addresses (only hashed)
- Does not use cookies for tracking (only for self-ignore feature)
- Does not transmit individual visitor data to third parties
- Does not track across sites
- Does not collect personal visitor information

**What Data Is Stored Locally:**
- Click counts per CSS selector
- Timestamp of each click
- Page URL where click occurred (optional, can be disabled)
- Hashed IP address (for rate limiting only)
- User agent string (for bot detection)
- User ID (only if user is logged in)
- Aggregated daily pageview counts (for telemetry reporting)

**What Data Is Transmitted:**
- Non-personal site-level data is sent weekly to plugins-for-wp.com to help improve the plugin (see External Services section above for full details)
- No individual visitor data, IP addresses, or click-level data is ever transmitted

== Changelog ==

= 1.0.4 =
* Added: Site telemetry system to collect non-personal site data for plugin improvement
* Added: Pageview tracking for aggregated traffic reporting
* Added: Activation and deactivation event reporting
* Updated: External Services and Privacy sections in readme with full data collection disclosure

= 1.0.3 =
* Fixed: Element picker now persists across page navigation using sessionStorage
* Fixed: Element picker toggle state preserved when navigating between pages
* Removed: Sweepstakes tab

= 1.0.2 =
* Changed: Updated all links to plugins-for-wp.com
* Changed: Replaced "Our Plugins" tab with "Sweepstakes" tab
* Changed: Updated branding from Stupid Simple Plugins to Simple Tools for WP

= 1.0.1 =
* Fixed: Database charset collation handling for better compatibility across different MySQL configurations
* Fixed: PHPCS compliance issues for WordPress.org submission
* Improved: Security with enhanced nonce verification
* Improved: Code structure following WordPress coding standards
* Added: Comprehensive database migration from legacy option-based storage to custom tables
* Added: Enhanced bot detection with expanded user agent patterns
* Added: IP-based rate limiting to prevent spam clicks
* Added: User role exclusion capabilities
* Added: Automatic data retention management
* Added: Visual element picker for easy CSS selector generation
* Added: Goal tracking with email notifications
* Added: Advanced analytics dashboard with charts
* Added: Click logs with detailed information
* Added: CSV export functionality
* Added: Self-ignore feature with cookie-based exclusion
* Added: Shortcode support for displaying click counts
* Updated: Database schema to use custom tables instead of options
* Updated: Admin interface with modern, user-friendly design
* Updated: Frontend tracking script for better performance

= 1.0.0 =
* Initial release
* Basic click tracking by CSS selector with AJAX
* Admin table with add/edit/delete and sortable rows
* Per-row and global count reset functionality
* Text-only showcase tab with external links
* Translation ready
* GPL-2.0-or-later license

== Upgrade Notice ==

= 1.0.4 =
Added site telemetry for plugin improvement. Non-personal site data is now collected weekly. See External Services section for full disclosure.

= 1.0.3 =
Fixed element picker navigation issue. Picker now persists across page changes. Removed Sweepstakes tab.

= 1.0.2 =
Updated branding and links. Changed "Our Plugins" tab to "Sweepstakes" tab.

= 1.0.1 =
Major update with custom database tables, visual element picker, analytics dashboard, goal tracking, and many new features. Automatically migrates your existing data. Recommended upgrade for all users.

= 1.0.0 =
Initial public release. Track clicks like a pro!