=== Measurement Pixel for OpenAI Ads ===
Contributors: eventsforai
Tags: openai, conversions api, pixel, ads, tracking
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add the OpenAI Ads measurement pixel to your site head and send conversion events server-side via the OpenAI Conversions API.

== Description ==

Measurement Pixel for OpenAI Ads adds the OpenAI Ads measurement pixel to your site and (optionally) sends the same events server-side through the OpenAI Conversions API, deduplicated with the pixel using a shared event ID.

**Free features**

* Loads the OpenAI Ads pixel in your site.
* Automatic `page_viewed` event in the browser.
* Optional server-side Conversions API sending with an on/off switch, deduplicated with the pixel via a shared event ID.
* For logged-in users, attaches hashed identifiers (`email_sha256`, `external_id_sha256`) following the documented OpenAI schema; the server side also adds raw `ip_address` and `user_agent`.
* Consent-aware: integrates with the WordPress Consent API, so the pixel and server events wait for marketing consent when a compatible cookie banner is active.
* One-click connection test.
* Detects active integrations locally, including network-active plugins and the Bricks parent theme.
* Shows a local OpenAI Ads Tracking Audit with a conversion coverage score and highlights conversion signals that are not tracked in Free.
* Shows a Pro offer matched to the integrations detected on your site; your plugin list is not sent to Events for AI.
* After sustained use, can show a low-frequency WordPress.org review request; it can be snoozed or dismissed.
* Clean interface.

**Pro (separate paid add-on)**

Pro adds automatic conversion tracking for sales, leads and appointment bookings. Browser pixel and optional server-side Conversions API events use shared event IDs for deduplication:

* WooCommerce: `contents_viewed`, `items_added`, `checkout_started`, `order_created`, plus `subscription_created` and `trial_started` (with WooCommerce Subscriptions).
* Forms: `lead_created` for Contact Form 7, Elementor Pro, Bricks, WPForms (Lite and Pro), Gravity Forms and Fluent Forms.
* Amelia: `appointment_scheduled` for new appointment bookings, including recurring appointments.
* Easy Digital Downloads 3+: `order_created` for completed live purchases, including order value, currency and products.
* `registration_completed` when a user signs up.
* Custom events from URL rules: send any event when a page URL contains or exactly matches a value (the Events tab).

WPForms, Gravity Forms, Fluent Forms, Amelia and Easy Digital Downloads integrations are included in Pro 1.1.0 and later. New form and Amelia events support AJAX submissions without requiring a page reload. EDD can send CAPI purchase events when a payment is confirmed asynchronously; the browser purchase event requires an authorised success-page visit.

The free plugin works on its own and never requires a license.

Learn more about [Measurement Pixel for OpenAI Ads Pro](https://eventsforai.com).

**Free vs Pro at a glance**

* Pixel install and `page_viewed` (pixel + Conversions API): Free.
* WooCommerce events (view, add to cart, checkout, order, subscription, trial): Pro.
* Local integration detection and a matched Pro offer: Free.
* Form events (Contact Form 7, Elementor Pro, Bricks, WPForms, Gravity Forms, Fluent Forms) and registration: Pro.
* Amelia appointment bookings: Pro.
* Easy Digital Downloads 3+ completed purchases: Pro.
* Custom events based on URL rules: Pro.
* De-duplication across pixel and server: `page_viewed` in Free, every event in Pro.

Check [full Free vs Pro comparison](https://eventsforai.com/measurement-pixel-openai-ads-free-vs-pro/).

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` or install it from the Plugins screen.
2. Activate it.
3. Open **Measurement Pixel → Settings**, paste your Pixel ID, and (optionally) enable the Conversions API and paste your API key.

Check [Step-by-step setup guide](https://eventsforai.com/measurement-pixel-for-openai-ads-setup/).

== Frequently Asked Questions ==

= Do I need the Conversions API key? =
No. The JS pixel works with just a Pixel ID. The API key only enables optional server-side sending.

= Where do I get the Pixel ID and API key? =
From the Conversions tab in your OpenAI Ads Manager.

= Does it send personal data? =
Only if you enable server-side sending for logged-in users. In that case the user's email and a derived identifier are hashed (SHA-256) before sending, following OpenAI's documented schema.

= What is the difference between Free and Pro? =
Free installs the pixel, supports `page_viewed` through the browser and optional Conversions API, and detects active integrations to show a matched Pro offer. Pro adds WooCommerce events, form events (Contact Form 7, Elementor Pro, Bricks, WPForms, Gravity Forms and Fluent Forms), Amelia appointment bookings, Easy Digital Downloads 3+ completed purchases, registration events and URL-based event rules. Browser and server events share event IDs for deduplication. Pro is a separate paid add-on; Free never requires a license.

= Which Amelia bookings does Pro track? =
Pro tracks new appointment bookings with approved or pending status, including recurring appointments. It does not count rejected, cancelled or waiting-list entries. This integration measures appointment reservations, not payments. Event tickets, package purchases and later status updates are not included.

= What does the Easy Digital Downloads integration track? =
Pro 1.1.0 supports completed live purchases in Easy Digital Downloads 3+, with order value, currency and product details. Pending, failed, refunded and test-mode orders do not generate new purchase events. Tracking requires attribution and marketing consent captured at checkout. Product views, cart actions and checkout-start events are not included in the EDD integration.

= Does Free send my active plugin list to Events for AI? =
No. Integration detection runs locally. It is used to tailor the Pro offer inside the plugin settings.

== External services ==

This plugin connects to the following third-party services.

1. OpenAI Ads (pixel SDK and Conversions API).
What it is and why: the plugin loads the OpenAI pixel script (https://bzrcdn.openai.com) on your front end and, when you enable and configure the Conversions API, sends conversion events to https://bzr.openai.com so OpenAI can measure ad conversions. This is the core purpose of the plugin.
Data sent: event type, source URL, timestamp, and — for logged-in users when enabled — hashed identifiers (email_sha256, external_id_sha256) plus raw IP address and user agent. The pixel SDK runs in visitors' browsers when enabled.
Terms: https://openai.com/policies/terms-of-use . Privacy: https://openai.com/policies/privacy-policy .

2. Events for AI (plugin news / admin notices).
What it is and why: once per day, while you are in the WordPress admin, the plugin requests https://eventsforai.com/wp-json/oaamp-ls/v1/notices to display security notices, product news and important update notices on the plugin's own admin pages. This service is provided by Events for AI (the plugin author).
What data is sent and when: only the plugin version and a flag indicating whether the Pro add-on is active. The request runs at most once per day. No personal data, visitor data, site content, or credentials are sent.
Terms of Service: https://eventsforai.com/terms/ . Privacy Policy: https://eventsforai.com/privacy/ .

Both endpoints are filterable, and the Conversions API is off by default.

== Screenshots ==

1. Plugin settings — add your Pixel ID, turn on the Conversions API (optional), and run a connection test.

== Changelog ==

= 1.1.0 =
* Add an OpenAI Ads Tracking Audit with a local 0–100 tracking score.
* Show detected conversion gaps for WooCommerce, supported form plugins, Amelia and Easy Digital Downloads.
* Add a low-frequency WordPress.org review request after at least 7 days, a successful connection test and several real server event send attempts. Review requests can be snoozed for 7 days or dismissed permanently.
* Refresh the translation template to include all current admin, audit, review and conversion-gap strings.

= 1.0.1 =
* Detect active integrations locally, including network-active plugins and the Bricks parent theme.
* Show a contextual Pro offer in plugin settings; hide it when Pro is active.
* Include contextual Pro messages for WPForms, Gravity Forms, Fluent Forms, Amelia and Easy Digital Downloads.
* Add English and Polish messages.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
Adds a conversion tracking audit, health score, contextual diagnostic upsells and a respectful review prompt.

= 1.0.1 =
Adds local integration detection and contextual Pro offers. Updates Pro integration descriptions for WPForms, Gravity Forms, Fluent Forms, Amelia and Easy Digital Downloads.

= 1.0.0 =
Initial release.
