=== Iteractive AI Site Sync and Publishing ===
Contributors: iteractive
Tags: woocommerce, meta pixel, google tag, ga4, product sync
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Pair your WordPress site with iteractive.ai: sync WooCommerce products, inject your Meta Pixel and Google Tag, and publish AI-written blog posts.

== Description ==

**Iteractive AI Site Sync and Publishing** is the official companion plugin for [iteractive.ai](https://iteractive.ai). It pairs your site with the iteractive.ai platform so you (the site owner) can:

* Inject **your own** Meta Pixel and Google Tag (GA4 / GTM) site-wide, without touching theme code.
* Mirror your **WooCommerce products** into iteractive.ai for ad-creative generation.
* Receive AI-written blog posts that you can review and publish automatically.
* Verify the site is connected from your iteractive.ai dashboard.

The plugin exposes a small, signed REST namespace (`iteractive/v1`) that only accepts requests carrying the random secret token generated during pairing.

== Privacy ==

* The plugin stores a paired secret, an iteractive.ai user ID, the Meta Pixel ID and the Google Tag ID in `wp_options`.
* The plugin itself does NOT collect or transmit visitor data. The Meta Pixel and Google Tag, when you configure them, fire from the visitor's browser to Meta and Google exactly as the standard scripts would. They are loaded only if you, the site owner, have entered the corresponding IDs from your iteractive.ai dashboard.
* Read the full privacy policy at https://iteractive.ai/privacy

== External services ==

This plugin relies on the following third-party services. They are only contacted under the conditions described below.

**1. iteractive.ai backend (Supabase Edge Functions at `https://hidheynlnzselakdqtxg.supabase.co`)**

* What it is: the iteractive.ai platform backend that the plugin pairs with.
* When data is sent: (a) once, when you click **Connect** on the plugin admin page and submit a pairing code (the site URL and a freshly generated plugin secret are sent in exchange for your iteractive.ai user ID); (b) when a manual sync action is triggered by you from your iteractive.ai dashboard.
* No automatic background calls are made by the plugin.
* Terms of service: https://iteractive.ai/terms
* Privacy policy: https://iteractive.ai/privacy

**2. Meta Pixel (`https://connect.facebook.net/en_US/fbevents.js` and `https://www.facebook.com/tr`)**

* What it is: Meta's standard JavaScript tracking pixel, provided by Meta Platforms, Inc.
* When data is sent: only if you, the site owner, have entered a Meta Pixel ID from your iteractive.ai dashboard. In that case the visitor's browser loads `fbevents.js` from `connect.facebook.net` and sends a standard `PageView` event to `facebook.com/tr` on every page load. If no Pixel ID is configured, no request is made.
* Terms of service: https://www.facebook.com/legal/terms
* Privacy policy: https://www.facebook.com/privacy/policy
* Business Tools Terms: https://www.facebook.com/legal/terms/businesstools

**3. Google Tag / Google Analytics (`https://www.googletagmanager.com/gtag/js` and the GA collect endpoint)**

* What it is: Google's standard `gtag.js` library, provided by Google LLC.
* When data is sent: only if you, the site owner, have entered a Google Tag / GA4 measurement ID from your iteractive.ai dashboard. In that case the visitor's browser loads `gtag/js` from `googletagmanager.com` and sends a standard page view event to Google. If no Tag ID is configured, no request is made.
* Terms of service: https://marketingplatform.google.com/about/analytics/terms/us/
* Privacy policy: https://policies.google.com/privacy

You are responsible for obtaining any consent (for example a cookie-consent banner) required in your jurisdiction before enabling the Meta Pixel or Google Tag IDs.

== Installation ==

1. Install from the WordPress.org plugin directory or upload the ZIP.
2. Activate **Iteractive AI Site Sync and Publishing**.
3. Open **Settings &rarr; Iteractive AI Site Sync** in the WordPress admin sidebar.
4. Open the iteractive.ai dashboard, copy the pairing code shown under **Settings &rarr; WordPress**, paste it into the plugin and click **Connect**.

== Frequently Asked Questions ==

= Do I need a paid iteractive.ai account? =

No. The plugin is free and works with the free iteractive.ai plan.

= Does the plugin work without WooCommerce? =

Yes. Product sync requires WooCommerce, but pixel injection and blog publishing work on any WordPress install.

= Will this conflict with Yoast, RankMath or Insert Headers and Footers? =

No. The plugin only writes the snippets you explicitly authorize from your iteractive.ai dashboard.

= How do I disconnect? =

Open **Settings &rarr; Iteractive AI Site Sync** in the admin sidebar and click **Disconnect**. All stored options are removed.

== Screenshots ==

1. The admin page — paste the pairing code shown in your iteractive.ai dashboard to connect the site.
2. Connected state — the site is paired and ready to receive product sync, tracking-tag updates and AI-generated posts.
3. Live preview of an injected Meta Pixel and Google Tag on the front-end (no theme code changes required).

== Changelog ==

= 1.0.3 =
* Renamed to **Iteractive AI Site Sync and Publishing**.
* Meta Pixel loader migrated from echoed `<script>` to `wp_enqueue_script` + `wp_add_inline_script`.
* `<noscript>` Pixel fallback moved from `wp_head` to `wp_body_open`.
* Admin page moved under **Settings** (no top-level menu item).
* Readme: documented Meta Pixel, Google Tag and iteractive.ai backend as external services with terms and privacy links.

= 1.0.2 =
* Initial release.

== Upgrade Notice ==

= 1.0.3 =
Renamed plugin, compliance fixes for the WordPress.org plugin directory.