=== GlanceLeader - Highlight CTAs & Boost Conversions ===
Contributors: ziher4
Tags: woocommerce, call to action, conversions, highlight, cta
Requires at least: 6.2
Tested up to: 7.0
Stable tag: 1.0.3
Requires PHP: 7.4
Text Domain: glanceleader
Domain Path: /languages
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Highlight buttons, CTAs and offers with animated cues that get more clicks - no code. Built-in analytics. Perfect for WooCommerce stores.

== Description ==

**Your visitors are missing your most important buttons.** Your "Add to Cart", your signup form, your limited-time offer - they scroll right past them. GlanceLeader draws the eye exactly where you want it, with subtle animated cues that turn ignored elements into clicked ones.

https://youtu.be/LY8dbYxuHZI

No shortcodes. No page builder. No CSS or JavaScript. Open the visual editor, click the element you want to highlight, choose how to highlight it, and save. That is the whole workflow.

**Want to try it first?** [Launch a free demo site with GlanceLeader already installed](https://tastewp.com/new/?pre-installed-plugin-slug=glanceleader&redirect=post-new.php%3Fpost_type%3Dglanceleader_camp&ni=true) - a disposable WordPress sandbox, no signup, ready in seconds.

**Built for store owners and marketers who care about conversions:**

* Make the **Add to Cart** button pulse so it is the first thing shoppers see
* Put a **glowing border** around a coupon or sale banner
* Draw attention to upsells, trust badges, or a "Buy now" call to action
* Guide first-time visitors to the one action that matters on each page
* With [GlanceLeader PRO](https://glanceleader.com/): **spotlight an offer** by dimming the rest of the page, or **point an animated arrow** at your signup form

**Prove it is working.** Built-in, privacy-first analytics show impressions, clicks on the highlighted element, and click-through rate for every campaign - so you can see exactly which cues drive action and double down. The built-in analytics use no third-party services, collect no personal data, and set no visitor cookies.

Animations play automatically as visitors scroll to each element - not as a forced guided tour, but as natural, eye-catching signals. Works with any theme and with WooCommerce and the block editor.

**Seven built-in cue types:**

* **Beacon** - A pulsing animated dot, like a sonar ping, placed on or around the element
* **Tooltip** - A styled popover with your custom message and background color
* **Border** - A spinning arc, neon glow, or breathing outline around the element
* **Glow** - A soft radiant glow emanating from the element
* **Hotspot** - A small persistent indicator dot at any corner of the element
* **Focus** - Camera-style corner brackets that lock onto the element like a viewfinder
* **Underline** - An animated line that draws itself beneath the element, ideal for headlines and links

**Five more cue types in the separate GlanceLeader PRO plugin:**

* **Spotlight** (PRO) - A full-screen vignette dimming everything except the target element
* **Shimmer** (PRO) - A diagonal light sweep across the element surface
* **Shake** (PRO) - A burst attention-grab that shakes the element then pauses
* **Pointer** (PRO) - An animated arrow or custom image pointing at the element from any direction
* **Scribble** (PRO) - A hand-drawn scribble that draws itself around the element, like a pen circling it on paper

New cue types are added regularly, so the collection keeps growing.

**Key features:**

* Visual point-and-click element selector - no CSS selectors to write manually
* Ancestor picker lets you target the exact element or any of its parents with one click
* Multiple steps per campaign, each targeting a different element
* Play all steps at once (parallel) or one after another (sequential)
* Per-step delay, dwell time, and pause controls
* Trigger options: every page load, once per visitor (configurable cookie lifetime, 30 days by default), or once per session
* Multiple campaigns can target the same page - they play independently, each with its own settings
* Smart launch - a cue can wait for its target element to appear, so it works with sliders, Elementor loop grids, and lazy-loaded content
* Respects the visitor's reduced-motion accessibility preference - cues render statically instead of animating
* Fully compatible with any theme - animations run as fixed-position overlays that never shift your layout
* Built-in analytics - track impressions, clicks, and click-through rate per campaign; the built-in stats use no third-party services
* Privacy-first analytics - aggregate counts only, no personal data and no visitor cookies
* Lightweight - no external dependencies, no SaaS, no iframe embeds
* Duplicate campaigns to reuse configurations across pages

**More in the separate [GlanceLeader PRO](https://glanceleader.com/) plugin:**

* Five extra cue types: Spotlight, Shimmer, Shake, Pointer (including custom images and animated GIFs), and the hand-drawn Scribble
* A/B testing - run multiple variants of a campaign and compare their click-through rates
* Conditions system - show a campaign only when a URL parameter, cookie, or user role matches
* Custom regex URL targeting
* Google Analytics integration - send cue events to your GA4 property, alongside the built-in cookie-free stats
* Import / Export campaigns as JSON - back up your work or move campaigns between sites
* Developer filters to extend or override plugin behaviour

**Pointer cue details (PRO):**

Three built-in SVG arrow presets (Arrow, Chevrons, Block arrow) plus a custom image field that accepts any URL, including animated GIFs. Position the pointer at any of 8 compass positions around the element, or centered on it. Choose from bounce-toward, pulse, or wobble animations and set the gap between pointer and element independently of element size.

**How it works:**

1. Create a new Campaign in the GlanceLeader admin menu
2. Set the target page and open the visual editor
3. Click "Select Element" and click any element on the page
4. Configure the cue type, color, timing, and animation style
5. Add as many steps as you need
6. Save - animations go live immediately for your visitors

**Conditions (PRO, optional):**

Each campaign can have one or more conditions that all must match for the campaign to run. Available condition types:

* URL parameter - check for the presence, absence, or value of a `?key=value` query string
* Cookie - check for the presence, absence, or value of a browser cookie
* User role - show only to logged-in users, logged-out users, or users with a specific role

== Installation ==

1. Upload the `GlanceLeader` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Go to **GlanceLeader** in the admin sidebar and click **Add Campaign**
4. Select your target page, click **Open Editor**, and start adding steps

== Frequently Asked Questions ==

= What languages is the plugin available in? =

The admin interface ships fully translated into Spanish, French, German, Italian, and Brazilian Portuguese, in addition to English. It is also fully translation-ready (a complete .pot template is included), so it can be translated into any language with a tool like Poedit or Loco Translate.

= Can I send the data to Google Analytics? =

Yes (PRO). Under GlanceLeader > Settings, enable the Google Analytics integration. GlanceLeader will fire `glanceleader_cue_shown`, `glanceleader_cue_click`, and `glanceleader_skip` events into your Google Analytics 4 property, each tagged with the campaign ID and A/B variant, so you can analyse cue performance inside your existing funnels and reports. If GA4 is already loaded on your site, events ride along with it automatically; otherwise you can enter your Measurement ID and GlanceLeader will load it for you. Your built-in, cookie-free stats keep working either way, and your own admin visits are never sent.

= Does it work with WooCommerce? =

Yes, and it is one of the most popular uses. You can highlight the Add to Cart button, put a glowing border around a sale or coupon, or draw attention to upsells and trust badges - and with the PRO cues, spotlight an offer or point an animated arrow at the checkout button. Because you pick elements visually on the live page, it works with any WooCommerce theme or storefront without configuration.

= Can it actually increase my conversions? =

GlanceLeader is designed to draw attention to the buttons and CTAs that matter most on each page. Its built-in analytics show you the real click-through rate of every campaign, so you can measure the impact on your own site and keep only the cues that work for you.

= Can I A/B test my cues? =

Yes (PRO). On any campaign you can turn on A/B testing and build multiple variants (A, B, C and so on), each with its own cues and play order. Visitors are split between the variants by the weights you set, and the Performance panel shows each variant's views, clicks, and click-through rate so you can see which performs best. Turn A/B testing off at any time and the variant you are viewing becomes the live one - the others are kept, in place, in case you want to test again later.

Note that each visitor keeps the variant they were first assigned (stored in their browser), so their experience stays consistent and the stats stay clean. This also means that when you test repeatedly in the same browser you will keep seeing the same variant - open a private/incognito window to be assigned fresh.

= How do the A/B variant weights work? =

Weights are relative shares, not literal percentages, so they do not need to add up to 100. Each variant receives its own weight divided by the total of all weights. A few examples:

* A = 50, B = 50 - an even 50/50 split
* A = 70, B = 30 - roughly 70% of visitors see A, 30% see B
* A = 1, B = 1, C = 1 - an even three-way split
* A = 2, B = 1 - variant A is shown twice as often as B (about 67% vs 33%)

Because the split is random per visitor, the actual numbers even out over traffic - the more visitors a campaign gets, the closer the real split lands to the weights you set. Start at equal weights to give each variant a fair test, and only use uneven weights when you deliberately want to limit how often a variant is shown.

A practical tip: give each variant enough time. A difference in click-through rate only becomes trustworthy after each variant has collected a few hundred views, so on low-traffic pages a meaningful result can take a while - read the Performance panel, not the first few visits.

= Does this work with any theme or page builder? =

Yes. All animations are rendered as `position: fixed` overlays appended to the page body, so they never interact with your theme's layout or shift any elements. It works with any theme and with the WordPress block editor.

= Will it slow down my site? =

No. The player script is only loaded on pages that have an active campaign. It has no external dependencies and weighs under 20 KB.

= Can I show different animations to different visitors? =

Yes (PRO), via conditions. You can show a campaign only to logged-in users, users with a specific role, visitors arriving via a particular URL parameter, or visitors with a specific cookie set. Multiple conditions are ANDed together.

= How does the analytics tracking work? Is it GDPR-compliant? =

GlanceLeader records only anonymous aggregate counts - how many times a campaign played, how many clicks the highlighted elements received, and how many visitors skipped. It stores no IP addresses, no personal data, and sets no tracking cookies on your visitors. Counts are kept in a single table in your own WordPress database and never sent anywhere. Because it sets no cookies and collects no personally identifiable information, there is typically nothing in the built-in analytics that would require a cookie-consent banner for GlanceLeader itself - though you should always confirm your own compliance obligations. Your own logged-in admin visits are excluded so the numbers reflect real visitors.

= What happens if the target element isn't on the page? =

GlanceLeader silently skips any step whose element selector doesn't match anything on the page. No errors are thrown.

If the element is built by JavaScript after the page loads - a slider or carousel, an Elementor loop grid, a lazy-loaded section, or content inside a tab - enable the step's "Smart launch" option. The cue then waits for the element to appear (up to 10 seconds) before playing instead of being skipped.

= Can I target elements inside the WordPress block editor? =

The visual editor works on your public-facing pages, not inside the WP admin block editor. Navigate to the target page on the frontend and use the editor bar at the bottom.

= What browsers are supported? =

GlanceLeader requires a modern browser: Chrome 105+, Firefox 110+, Safari 16.2+, or Edge 105+. Internet Explorer is not supported. Visitors on older browsers will simply not see the animations - your page content is unaffected.

= Does this work on mobile? =

Yes. The animations are responsive - overlay positions are recalculated on scroll and window resize.

= Can I export and import my campaigns? =

Yes (PRO). Go to GlanceLeader > Settings and scroll to the Import / Export section. Select the campaigns you want and click "Export selected" to download a JSON file. To import, upload a previously exported JSON file. Campaigns are created as new posts - your existing campaigns are never overwritten.

= Can I use animated GIFs as pointers? =

Yes (PRO). The Pointer cue is part of GlanceLeader PRO: select it, choose "Custom image" as the pointer style, and paste any image URL - including animated GIFs - or pick one with the built-in WordPress Media Library button. You can also set a rotation in degrees for custom images.

== Developer Hooks (PRO) ==

**These filters are a PRO feature.** GlanceLeader exposes the following PHP filters so developers can extend or override behaviour without modifying plugin files. They are available only in the PRO version - in the free version this code is not present, so the filters do not fire.

= glanceleader_campaign_data =

Modify the full data payload sent to the player before it is output to the page. Runs on every page load where a matching campaign is found, and also in the visual editor. The second argument is the campaign post ID.

    add_filter( 'glanceleader_campaign_data', function ( $data, $campaign_id ) {
        // Add extra steps, swap the trigger, override skip settings, etc.
        $data['trigger'] = 'always';
        return $data;
    }, 10, 2 );

The `$data` array contains: `id`, `trigger` (always/once/session), `mode` (parallel/sequential), `steps` (array), `skip` (array), and `ab` (A/B test config: `enabled`, `live`, `variants`).

= glanceleader_steps_before_save =

Filter the steps array before it is persisted to the database. Runs during the AJAX save triggered by the visual editor. The second argument is the campaign post ID.

    add_filter( 'glanceleader_steps_before_save', function ( $steps, $post_id ) {
        // Validate, sanitize, or inject steps before saving.
        return $steps;
    }, 10, 2 );

= glanceleader_skip_data =

Override the skip button configuration for a specific campaign. Useful for showing or hiding the button based on the current user, role, or request context.

    add_filter( 'glanceleader_skip_data', function ( $skip, $post_id ) {
        // Hide the skip button for logged-in users.
        if ( is_user_logged_in() ) {
            $skip['enabled'] = false;
        }
        return $skip;
    }, 10, 2 );

The `$skip` array contains: `enabled` (bool), `text` (string), `position` (top-right/top-left/bottom-right/bottom-left).

= glanceleader_url_matches =

Override the built-in URL matching logic. Return `true` or `false` to short-circuit the default matching. Return `null` (or do not return a value) to let the default logic run.

    add_filter( 'glanceleader_url_matches', function ( $result, $current_url, $pattern ) {
        // Example: also match when a custom query parameter is present.
        if ( isset( $_GET['gp_preview'] ) ) return true;
        return $result; // null = use default matching
    }, 10, 3 );

= glanceleader_conditions_pass =

Override the result of the conditions check for a campaign. Receives the boolean result after all built-in conditions have been evaluated, plus the raw conditions array. Use this to add support for custom condition types.

    add_filter( 'glanceleader_conditions_pass', function ( $passed, $conditions ) {
        // Example: block campaigns on weekends regardless of other conditions.
        if ( in_array( date('N'), ['6', '7'] ) ) return false;
        return $passed;
    }, 10, 2 );

= glanceleader_campaign_post_statuses =

Control which campaign post statuses are eligible to load on the frontend. By default, admins see publish/private/draft; other visitors see publish only.

    add_filter( 'glanceleader_campaign_post_statuses', function ( $statuses ) {
        // Example: never show draft campaigns, even to admins.
        return ['publish'];
    } );

== External services ==

GlanceLeader's built-in analytics are fully self-contained: they are stored in your own WordPress database and are never sent anywhere.

The plugin connects to the following external services:

**Freemius** - our licensing, software-update, and (optional) usage-analytics provider.

- What it is and what it's used for: GlanceLeader uses the Freemius SDK to manage licensing and plugin updates, and - only if you opt in when prompted at activation - to collect anonymous usage data that helps us improve the plugin. Opting in is optional; you can skip it and the plugin keeps working fully.
- What data is sent and when: only if you click "Allow & Continue" on the activation screen, Freemius collects data such as your site URL, WordPress and PHP versions, active theme and plugins, and your admin email address. If you skip the opt-in, none of that is sent. License and update checks (site URL plus plugin version) are sent when applicable.
- Service provider: Freemius, Inc. Terms of Service: https://freemius.com/terms/ - Privacy Policy: https://freemius.com/privacy/

**Google Analytics (Google Tag / gtag.js)** - part of the optional Google Analytics integration (a PRO feature, disabled by default).

- What it is and what it's used for: when enabled, GlanceLeader sends cue interaction events to your own Google Analytics 4 property so you can analyse cue performance alongside the rest of your site analytics.
- What data is sent and when: only when the integration is enabled and a cue is shown, clicked, or skipped on the front end, the plugin sends event names (`glanceleader_cue_shown`, `glanceleader_cue_click`, `glanceleader_skip`) each tagged with the campaign ID and A/B variant label, to your configured GA4 Measurement ID. If a GA4 tag is already present on the page, the events ride along with it; otherwise the plugin loads Google's `gtag.js` from `https://www.googletagmanager.com`. No data is sent while the integration is disabled.
- Service provider: Google. Terms of Service: https://policies.google.com/terms - Privacy Policy: https://policies.google.com/privacy

== Screenshots ==

1. The visual editor panel - select elements and configure steps directly on the page
2. Step configuration form - cue type, animation, color, and timing in one place
3. Beacon cue playing on a call-to-action button
4. Border arc animation highlighting a pricing card

== Changelog ==

= 1.0.3 =
* New: two more free cue types - Focus (camera-style corner brackets) and Underline (an animated line beneath the element)
* New: "Smart launch" option per step - the cue waits (up to 10 seconds) for its target element to appear before playing, for content built by JavaScript after page load (sliders, Elementor loop grids, lazy-loaded or tabbed sections)
* New: Scribble cue type (PRO) - a hand-drawn scribble that draws itself around the element, with colour, line width, offset, and loop options
* New: the A/B Performance panel warns when a test is enabled but traffic is not actually being split (e.g. the PRO license is not active on the serving site)
* Improved: the visual editor is now shielded from theme styles, so its controls look consistent on any site

= 1.0.2 =
* New: text alignment (left/center/right) for the Tooltip cue and the Spotlight label
* New: background and accent color options for the Spotlight label (PRO)
* New: the "Once per visitor" trigger cookie lifetime is now configurable per campaign (default stays 30 days)
* New: a one-time, dismissible review request shown on GlanceLeader screens after a campaign passes 100 views
* Fix: A/B testing always played one variant regardless of weights - the picker now splits traffic by the weights you set (PRO)
* Fix: the Tooltip and Spotlight "Width" setting had no effect - it now applies
* Fix: the visual editor and campaigns now load on pages with query-string URLs (e.g. Elementor library templates, draft previews)
* Change: the A/B Performance panel now shows per-variant stats without auto-picking a "winner" - decide from the numbers yourself (PRO)
* Change: A/B weights are shown as relative shares that need not add up to 100
* Improved: your PRO license Account page is now reachable under the GlanceLeader menu
* Developer: the PHP filter hooks were renamed to a lowercase glanceleader_ prefix (e.g. glanceleader_campaign_data) for consistency
* Updated the Freemius SDK to the latest version

= 1.0.1 =
* Fixed an error during an upgrade to PRO version
* Updated the Freemius SDK to the latest version

= 1.0.0 =
* Initial release
* Five free cue types (beacon, tooltip, border, glow, hotspot) plus four PRO cue types (spotlight, shimmer, shake, pointer)
* Visual point-and-click element selector with ancestor picker
* Sequential and parallel play modes
* Per-step delay, dwell, and pause controls
* Trigger: always, once per visitor, once per session
* Pointer cue type (PRO): three built-in SVG arrow presets plus custom images (including animated GIFs), 9 positions, bounce/pulse/wobble animations
* Multiple campaigns can target the same page - they play independently
* Respects the visitor's reduced-motion accessibility preference
* Duplicate campaign action in the campaign list
* Built-in privacy-first analytics: impressions, clicks, click-through rate, and skips per campaign - no personal data, no visitor cookies
* Performance panel on each campaign plus a "Last 7 days" column in the campaign list
* Translations for Spanish, French, German, Italian, and Brazilian Portuguese
* Support / Debug info panel under GlanceLeader > Settings
* Free version: unlimited campaigns and steps, with five cue types (beacon, tooltip, border, glow, hotspot)
* Import / Export campaigns as JSON (PRO): back up or move campaigns between sites
* A/B testing (PRO): multiple variants per campaign with per-variant stats and winner highlighting
* Google Analytics integration (PRO): send cue events to your GA4 property
* Conditions system (PRO): URL parameters, cookies, user role
* Regex URL matching (PRO)
* Additional cue types (PRO): spotlight, shimmer, shake, pointer (including custom images)

== Upgrade Notice ==

= 1.0.0 =
Initial release.
