=== Max OpenAI Ads ===
Contributors: max
Tags: openai, ads, tracking, pixel, conversion, max, analytics
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.2.16
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WordPress to OpenAI Ads: track conversions, server events, and performance.

== Description ==

Max OpenAI Ads connects your WordPress site to OpenAI Ads. Track page visits, sign-ups, form submissions, and WooCommerce purchases so you can measure results from your ads.

Built by [Max](https://maximmiller.ca).

== Installation ==

1. Delete any old copies of this plugin from `wp-content/plugins/` first (see below).
2. Upload `max-openai-ads.zip` via **Plugins → Add New → Upload Plugin**.
3. Activate the plugin in the **Plugins** screen.
4. Open **Max OpenAI Ads** in the left menu, add your Pixel ID, and save.
5. Open **Max OpenAI Ads → Overview** to view charts and recent activity.

== Frequently Asked Questions ==

= Where do I find my Pixel ID? =

Open OpenAI Ads Manager and go to the Conversions section.

= I see "Plugin file does not exist." or "Destination folder already exists." What do I do? =

WordPress could not remove an old install folder on your server. Upload `max-openai-ads.zip` (v1.2.4+). It installs to a fresh folder `max-openai-ads/` so you do not need FTP. You can ignore any broken leftover entry for the old `max-openai-ad-manager` folder.

= Does this work with WooCommerce? =

Yes. Turn on **Store purchases** when WooCommerce is installed.

= Where do I get a conversion key? =

In OpenAI Ads Manager, open Conversions and choose Manage conversion keys. The key starts with sk-svcacct- and is different from general API keys.

= Does the plugin support server-side tracking? =

Yes. Paste your conversion key (sk-svcacct-…) in Settings, enable Conversions API, and the plugin sends server events to OpenAI. You can test the key before saving.

= What is the advertiser API key for? =

Optional. Add it from Ads Manager → Settings to verify your account and pull ad impressions, clicks, and spend into Overview.

= Where do I see conversion charts? =

Open **Max OpenAI Ads → Overview** in your WordPress dashboard.

= My site uses a security plugin with CSP rules. What should I allow? =

Allow scripts from `https://bzrcdn.openai.com` and connections to `https://bzr.openai.com`.

== Changelog ==

= 1.2.6 =
* Fix OpenAI Ads performance insights failing when the API requires hour-aligned time ranges.

= 1.2.5 =
* Overview is now the main admin page with setup checklist and dismissible action cards.
* In-dashboard plugin updates from the official download site.
* Advertiser API keys (including sk-svcacct-) are accepted when testing and saving.
* Automatic patch version bumps when plugin source files change (build and git pre-commit).

= 1.2.4 =
* Release zip installs to `max-openai-ads/` folder to avoid conflicts when an old `max-openai-ad-manager/` folder cannot be deleted.

= 1.2.3 =
* Fix activation on more hosts: dual entry points (max-openai-ad-manager.php + index.php shim) and zip verification on build.

= 1.2.2 =
* Fix WordPress activation: canonical main file max-openai-ad-manager.php and Linux-safe zip paths.

= 1.2.1 =
* Unified API key handling for conversion keys (sk-svcacct-) and optional advertiser keys.
* Test conversion and advertiser keys before saving; auto-enable CAPI when a conversion key is saved.
* OpenAI Ads performance panel on Analytics when an advertiser key is configured.
* Clearer Settings UI explaining what each key type is used for.

= 1.2.0 =
* Added Conversions API support with secure conversion key storage.
* Server-side event delivery with pixel deduplication via shared event IDs.
* Test conversion key button and delivery status in Settings.

= 1.1.0 =
* Added Analytics dashboard with charts and recent activity.
* Added creator link to maximmiller.ca.

= 1.0.0 =
* Initial release.
