=== Linkyy - A Link Click Tracker ===
Contributors: linkyy
Tags: click tracking, analytics, link tracking
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lightweight link click tracking with admin dashboard analytics for WordPress.

== Description ==

Linkyy tracks link clicks on your WordPress site and provides a clean admin dashboard to analyze which links get the most clicks.

**Features:**

* Lightweight frontend scripts (about 5KB gzipped)
* Admin dashboard with sortable table view
* Optional tracking of clicks on buttons, toggles, tabs and submit buttons
* Filter by date range, device type, and visitor type
* Consent mode support for GDPR compliance
* Role-based tracking exclusions
* Automatic data retention cleanup

**Using the dashboard:**

After installing, visit Linkyy → Dashboard. The dashboard automatically shows data for the page with the most clicks once tracking begins. Use the search box at the top to switch to any other tracked page. If you don't see data immediately, it just means no visitors have clicked links yet — typically you'll see data within minutes of your first visitor.

**Want more? [Upgrade to Linkyy Pro](https://linkyy.io)**

* Visual heatmap overlay with color-coded click badges on your live pages
* Click count badges & tooltips with desktop/mobile and logged-in/out breakdowns
* CSV / JSON export for page-level or site-wide analytics
* Role-based overlay access controls
* Priority email support & lifetime updates

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/linkyy/`
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Configure settings under Linkyy > Settings

== Frequently Asked Questions ==

= Does this slow down my site? =

The two frontend scripts total about 18KB raw (about 5KB gzipped) and load in the footer. They have zero impact on page rendering.

= What links does it track? =

Linkyy automatically tracks clicks on all links (`<a>` tags) across your site. No manual setup is required. Common page builder editor classes (Elementor, Beaver Builder, WPBakery, Bricks, etc.) are automatically excluded to avoid tracking builder UI clicks.

= Can it track buttons, accordions and tabs? =

Yes. Linkyy also counts clicks on buttons, toggles (accordions, "show more", `<details>`), tabs and form submit buttons, and the dashboard's Pages view gets a Links | Interactions switch. Toggles count opens and closes separately; the main click figure counts opens. Submit counts clicks on the submit button, not completed submissions, and pressing Enter to submit isn't counted. Form fields and anything visitors type are never read. Add `data-linkyy-track` to any other element to count it, or `data-linkyy-ignore` to leave one out. To count links only, untick "Track buttons and toggles" under Linkyy > Settings.

= Does it track admin users? =

By default, administrators are excluded from tracking. You can configure which roles are excluded under Linkyy > Settings.

= Is it GDPR compliant? =

Linkyy does not store any personal data — it only records aggregated daily click counts per link. It also includes configurable data retention and a manual consent mode that lets you delay tracking until visitor consent is granted.

= How does the confidence rating work? =

Each link receives a Low, Medium, or High confidence rating based on its total click count. The thresholds are customizable in settings (defaults: 10 for Medium, 50 for High).

= I just installed the plugin and the dashboard looks empty. Is it broken? =

No — the dashboard only shows data once visitors have actually clicked links on your site. As soon as any click is recorded, the dashboard automatically selects your most-clicked page and shows the data. To test, visit your site in an incognito window (administrators are excluded from tracking by default) and click any link, then refresh the dashboard.

= What's in Linkyy Pro? =

Linkyy Pro adds visual heatmap overlays with click badges for links, buttons and toggles, CSV/JSON export, role-based overlay access, and link groups (total clicks in a page region, like a sidebar, across every page that has it, set up by clicking the region on the page). Learn more at [linkyy.io](https://linkyy.io).

== Screenshots ==

1. Admin dashboard — sortable table with click counts, device breakdown, and confidence ratings.
2. Settings page — configure data retention, role exclusions, button and toggle tracking, consent mode, and confidence thresholds.

== Changelog ==

= 1.2.0 =
* New: tracking of clicks on buttons, toggles, tabs and submit buttons, shown beside link clicks on the dashboard. On by default; untick "Track buttons and toggles" under Settings to count links only. Toggles record opens and closes separately, and form fields are never read
* Dashboard: Links | Interactions switch on the Pages view, with Total / Links / Interactions stat cards and an interactions table (type, opened / closed for toggles)
* Dashboard: the page list counts interaction clicks too, so a page with only button or accordion clicks appears
* Dashboard: reworked toolbar for choosing the page, date range, device and visitor type, and skeleton placeholders while data loads instead of a spinner
* Dashboard: other plugins' admin notices now sit together under the Linkyy header instead of inside the page
* Settings: grouped into sections with a single save bar
* Tracking endpoint no longer errors when a click event's link text isn't a string
* REST: `/clicks?kind=interactions` and an `interaction_count` on `/pages`; responses without `kind` are unchanged
* New database table `{prefix}linkyy_interactions`, covered by data retention and uninstall
* Developer: new filters and actions for add-ons: `linkyy_tracker_config`, `linkyy_tracking_enqueued`, `linkyy_event_tracked`, `linkyy_interaction_tracked`, `linkyy_interaction_selectors`, `linkyy_dashboard_tabs` and `linkyy_dashboard_panels`
* Developer: `Linkyy.eventDecorators` in the tracker script lets add-ons add fields to link and interaction events; `Linkyy.selectorUtils` exposes the selector stability helpers, and `Linkyy.generateSelector` accepts any element

= 1.0.1 =
* Dashboard: auto-select the most-clicked page on first load instead of showing a blank state
* Dashboard: clearer empty-state messaging for new installs and date ranges with no data
* Added a "Showing top page" hint when selection is automatic
* Dashboard: clicking the page search bar now reopens the full list and selects the current text, so switching pages no longer requires manually clearing the URL

= 1.0.0 =
* Initial release
