=== Notikit ===
Contributors: notikit
Tags: social proof, notifications, recent sales, sales popup, woocommerce
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Show social proof notifications from Notikit: recent sales, live visitors, reviews and more. Optional WooCommerce recent purchases feed.

== Description ==

Notikit is a social proof service. You design notifications in your Notikit account (recent purchases, people viewing now, reviews, countdowns, announcements and more) and they appear as small pop-ups on your site.

This plugin connects your WordPress site to your Notikit account:

* **Pixel:** paste your Notikit pixel key (or the whole snippet, the plugin extracts the key) and the plugin loads the Notikit script on your site. No theme editing needed. It is never loaded on the cart, checkout, "order received" and "My account" pages. You can also turn it off for logged-in administrators.
* **Recent purchases for WooCommerce (optional):** paste the webhook URL of a Notikit "Conversions" notification and every real sale is shared once, in the background, so the notification shows real recent purchases. Only collected sales count: orders paid online (card, wallet) are shared when paid; cash on delivery, bank transfer and check orders are shared when you mark them "Completed". Free orders are not shared. You choose exactly which data is sent: first name, city (or country), product name, product link, product image, price. By default only the first name, the city and the product name are sent. Email, phone, street address and last name are never sent.
* **Test button:** send one sample purchase marked "[TEST]" to check the connection. Notikit keeps test entries out of the notifications your visitors see. Nothing is sent unless you click it.

The plugin itself adds nothing else to your public pages and has no tracking or telemetry of its own.

= Requires a Notikit account =

The notifications are created, designed and served by Notikit (https://notikit.com), an external service. The plugin is free and fully functional; the Notikit service has a free plan (1 campaign, 3 notifications, 1,000 impressions per month, 4 notification types) and paid plans from USD 9 per month with more impressions, sites and notification types, with a 14-day free trial. See https://notikit.com/plan for current details.

Depending on your Notikit plan, the notifications shown by the service may include a small Notikit branding link. That branding is part of the service and is configured in your Notikit account, not by this plugin.

== External services ==

This plugin connects to Notikit (https://notikit.com), a social proof notification service operated by Notikit. It is needed to display the notifications.

1. **Notikit pixel** (`https://notikit.com/pixel/<your pixel key>`): when you save a pixel key and leave "Load the Notikit pixel" enabled, the pages of your public site load this script, except the WooCommerce cart, checkout, "order received" and "My account" pages. Each visitor's browser then connects to notikit.com. Notikit receives the visitor's IP address, browser user agent and language, the page URL and title, the referring page, and events about the notifications (shown, clicked, closed), in order to display the notifications and count impressions. The script stores small display preferences in the browser's local storage (for example, notifications the visitor closed). Notikit also offers an optional "form capture" feature that the site owner can turn on in their Notikit account; when it is on, data typed in forms on pages where the script runs is sent to Notikit. This plugin does not turn it on. No data is sent before you enter a pixel key.

2. **Notification webhook** (`https://notikit.com/pixel-webhook/<notification key>`), WooCommerce only: when you save a webhook URL, each real sale is sent once, from your server: orders paid online when they are paid, and cash on delivery, bank transfer and check orders when they are marked "Completed". It contains only the data you checked (the customer's first name; the city, sent as `city` and `place`, or the country name as `place` when there is no valid city; and the name, link, image and price/currency of the first product) plus `order`, a 10 character non-reversible code derived from the order ID with your site's secret salt. That code does not reveal the order number; it only lets Notikit tell two identical purchases apart. The "Send test order" button sends sample data marked as a test (`test` = 1), only when you click it. Nothing is sent while the webhook URL is empty.

Notikit terms of service: https://notikit.com/page/terms
Notikit privacy policy: https://notikit.com/page/privacy

== Installation ==

1. Install and activate the plugin.
2. Create a free account at https://notikit.com/register, create a campaign for your site's domain and add a notification.
3. In Notikit, open the campaign and click "Install pixel". Copy the snippet.
4. In WordPress go to Settings > Notikit, paste it in "Pixel key" and save.
5. Optional, with WooCommerce: create a "Conversions" notification in Notikit, open its "Data source" tab, copy the URL of the "Webhook trigger" field and paste it in "Notification webhook URL". Use the variables in the notification text, for example title `{name} from {place}` and description `Just bought {product}`.

== Frequently Asked Questions ==

= Is the plugin free? =

Yes. The plugin is free and GPL licensed. Notikit, the service it connects to, has a free plan and paid plans.

= Notifications do not appear. What should I check? =

The campaign domain in Notikit must match your site's domain (with or without "www"). Also check that the campaign and the notification are enabled, that your plan has impressions left, and that "Do not load it for logged-in administrators" is not hiding them from you.

= Which customer data is sent? =

Only for WooCommerce orders, only if you entered a webhook URL, and only the fields you checked. The name is reduced to the first word of the billing first name, skipping courtesy titles such as "Mr" or "Sra."; a company name is replaced by "Someone". A city that contains digits, looks like an address or is a placeholder such as "N/A" is not sent; the country name is used instead. Email, phone, street address, postcode and last name are never sent. Each delivery also includes `order`, a short non-reversible code that does not reveal the order number.

= When is an order sent? =

Only when the sale was really collected: orders paid online (card, wallet and other gateways that charge at checkout) when they become "Processing" or "Completed"; cash on delivery, bank transfer and check orders only when you mark them "Completed". Developers can change this with the `notikit_order_is_reportable` filter.

= Will old orders be sent? =

No. Orders are sent when they become a collected sale, and orders paid more than 3 days ago are skipped, so a bulk status change of old orders does not flood your notification. Cash on delivery, bank transfer and check orders must also have been created in the last 30 days.

= Can an order be sent twice? =

No. Each order is marked the first time it is queued and is never queued again, even if it changes status later. Queuing and sending take a short lock, so two simultaneous events produce one delivery. Failed deliveries are retried up to 3 times, and a retry carries exactly the same data, which Notikit ignores if it already arrived.

= What happens if an order is refunded or cancelled after it was sent? =

A purchase that was already sent is not removed automatically. To remove it, open your notification in Notikit, go to its "Data" tab and delete that entry.

= Does it work with High-Performance Order Storage (HPOS)? =

Yes. It only uses the WooCommerce order API and declares HPOS compatibility.

= Does it slow down my checkout? =

No. Deliveries run in the background with Action Scheduler (included in WooCommerce) and a short timeout. If Notikit cannot be reached, the order is not affected.

= Is there a filter for developers? =

`notikit_load_pixel` (bool) decides whether the pixel loads on a page. `notikit_webhook_payload` (array, WC_Order) filters the data sent for an order. `notikit_order_is_reportable` (bool, WC_Order, new status) decides whether an order counts as a collected sale. `notikit_max_order_age` (seconds) changes the 3 day limit. `notikit_webhook_host_allowlist` (array) is meant for automated tests with a local receiver.

== Screenshots ==

1. A WooCommerce store showing a Notikit "recent purchase" notification.
2. Settings > Notikit in the WordPress admin: pixel key, recent purchases webhook, the data to send and the test button.
3. The Notikit dashboard, where you create the campaign for your site and its notifications.

== Changelog ==

= 1.0.0 =
* First release: pixel loading, WooCommerce recent purchases webhook with field selection, test button, privacy policy text. Translations are provided through translate.wordpress.org.

== Upgrade Notice ==

= 1.0.0 =
First release.
