=== fnlowl ===
Contributors: fnlowl
Tags: lead capture, lead magnet, popup, newsletter, quiz
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add consent-gated FnlOwl lead-capture widgets to WordPress.

== Description ==

FnlOwl lets you place lead magnets, quizzes, surveys, calculators, popups, and announcement bars on your WordPress site. Add your FnlOwl site key once, then place an in-content widget with the FnlOwl Widget block or `[fnlowl id="wg_..."]` shortcode.

The plugin does not load FnlOwl until your site's consent manager signals that the visitor has accepted the category you choose. This keeps the choice of consent category and policy with the site owner.

== Installation ==

1. Install and activate the plugin.
2. Go to **Settings > FnlOwl** and enter the site key from FnlOwl **Settings > Install**.
3. Configure your consent manager or theme to run this after the visitor grants your chosen consent category:

   `window.fnlowlConsentGranted = true; document.dispatchEvent(new Event('fnlowl_consent_granted'));`

4. Add the **FnlOwl Widget** block, or use `[fnlowl id="wg_your_widget_id"]`, where an in-content widget should appear.

Until step 3 occurs, the plugin does not load the FnlOwl CDN script or connect to FnlOwl services.

== External services ==

This plugin requires the FnlOwl service to display and process widgets. It makes no connection until the site's consent mechanism grants permission.

After consent, the plugin loads `https://cdn.fnlowl.com/embed.js`. The embed connects to `https://api.fnlowl.com` to obtain the configured widget and record a widget view. These requests include the site key, widget identifier, standard browser request metadata such as IP address and referring origin, and the browser's normal request headers.

When a visitor submits a widget, the embed sends the data entered into that widget, such as an email address and quiz or survey answers, plus the referrer. FnlOwl uses this data to display the widget, count views, capture leads, deliver the requested lead magnet, and run the account owner's configured follow-up or integrations.

After consent, the embed stores a per-widget cooldown timestamp in the visitor's browser local storage so dismissed or completed widgets are not repeatedly shown. It does not store form answers there.

FnlOwl's [Terms of Service](https://fnlowl.com/policy/terms/) and [Privacy Policy](https://fnlowl.com/policy/privacy/) apply to this service.

== Frequently Asked Questions ==

= Why is nothing loading after activation? =

The plugin is consent-gated. Configure your consent manager or theme to set `window.fnlowlConsentGranted` to `true` and dispatch the `fnlowl_consent_granted` event after the visitor accepts your selected category.

= Do I need to edit my theme? =

Only if your consent manager cannot run custom JavaScript after consent. The FnlOwl setup guide documents the event interface.

= Where do I find the widget ID? =

Open the widget in the FnlOwl dashboard and use the `wg_...` identifier from its URL.

== Changelog ==

= 1.0.0 =
* Consent-gated script loading, site-key settings, shortcode, and block.
