=== PixelSift for WooCommerce ===
Contributors: tjrtmonline
Tags: google analytics, google tag manager, tracking, pixel, woocommerce
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Find duplicate, broken or misconfigured GA4, GTM, Meta Pixel and Google Ads tags on your WooCommerce store. Get a health score and fix steps.

== Description ==

Tracking tags are easy to install twice. A theme adds a GA4 snippet, a plugin adds the same ID again, Google Tag Manager loads a third copy, and your purchases are counted twice. PixelSift for WooCommerce checks your own store's pages and tells you, in plain English, what is wrong and how to fix it.

PixelSift is read-only and runs on your own server. By default it makes no external calls. No data leaves your site.

= What it checks =

PixelSift scans the front end of your own store: the home page, a product page, the cart page, the checkout page and the order-received page (loaded without an order). On those pages it looks for:

* **Google Analytics 4 (gtag.js)**: the same measurement ID set up by more than one plugin or snippet, the same ID configured twice on one page, gtag.js loaded more than once, and more than one GA4 ID.
* **Google Tag Manager**: the same container loaded twice or by two sources, several containers, and GA4 loaded directly while a container is also present (a common cause of double counting).
* **Meta Pixel**: the same pixel ID initialised more than once or by two sources, more than one pixel ID, the pixel library loaded twice, and pixel events with no pixel base code.
* **Google Ads**: the same AW- conversion ID set up more than once.
* **Universal Analytics leftovers**: old UA-style tags that no longer collect data and can be removed.
* **TikTok, Pinterest and Microsoft Advertising (UET)**: the same pixel set up more than once.
* **Ecommerce events**: the purchase event sent by more than one plugin, tags with no purchase event, and a product page with no ecommerce events.

For each tag it shows which plugin, theme or must-use plugin added it.

= Plugin conflicts =

Many stores run more than one tracking plugin. PixelSift flags common overlaps between:

* Site Kit by Google
* GTM4WP
* PixelYourSite
* Meta for WooCommerce
* Google Analytics for WooCommerce

PixelSift works alongside these plugins and does not replace them. It points out where two of them, or a plugin and your theme, are sending the same tag.

= Health score and fix guidance =

Every scan gives a 0–100 health score with a breakdown that shows exactly how many points each finding cost. Each finding explains what was detected, on which page, why it matters, and the steps to fix it, with a link to the right settings screen of the plugin involved. For example: "keep one source for this GA4 ID and turn off the other". Only problems PixelSift can prove from your pages (the same ID twice, the same code block repeated) lower the score. Checks it cannot prove, for example two plugins both set up to send purchases but with different or unknown IDs, are shown as "Info" (worth checking) and cost no points. You can mark a finding as reviewed, for example when two GA4 IDs are intentional, and it stops counting against the score.

= Everything is free =

All scanning, the health score and the fix guidance are included in this plugin. No feature is locked, time-limited or limited by quota.

= Privacy =

* No external calls. Scans request your own store's pages from your own server with a WordPress loopback request (`wp_remote_get` to your own site address, 20-second timeout per page). Requests to any other host are refused.
* No data is sent to the plugin author or any third party.
* No visitor or customer data is read. The scanner looks at the page code your store serves, not at orders or customers.
* No tracking, analytics or "phone home" inside the plugin.

= Limits =

PixelSift reads the HTML and scripts your pages serve. It cannot see:

* tags inside a Google Tag Manager container, because reading the container would mean contacting Google;
* server-side events (such as the Meta Conversions API, server-side GTM or the Measurement Protocol), except as hints in the page code;
* settings inside your Google or Meta accounts;
* tags that are added later by JavaScript, or only after a visitor accepts a cookie banner, if they are not in the page code;
* purchase events as they happen, because it never creates test orders.

If your server cannot make a loopback request to itself (some hosts block this), the scan reports which pages could not be loaded.

PixelSift is an independent tool. It is not affiliated with or endorsed by Automattic, WooCommerce, Google or Meta. WooCommerce is a trademark of Automattic Inc. Google Analytics, Google Tag Manager and Google Ads are trademarks of Google LLC. Meta is a trademark of Meta Platforms, Inc.

== Installation ==

1. In your WordPress admin, go to Plugins → Add New and search for "PixelSift for WooCommerce", or upload the zip file with Plugins → Add New → Upload Plugin.
2. Activate the plugin. WooCommerce must be installed and active.
3. Open WooCommerce → PixelSift. A first scan runs in the background shortly after activation.
4. Click "Scan now" (or "Scan again") and review the score and findings. Users need the "manage_woocommerce" capability (shop managers and administrators).

You can also run a scan from WP-CLI: `wp pixelsift scan` (add `--format=json` for machine-readable output) and `wp pixelsift report`.

== Frequently Asked Questions ==

= Does PixelSift send any data off my site? =

No. By default the plugin makes no external calls. Scans request your own store's pages from your own server, and results stay in your WordPress database. Nothing is sent to us or to any third party.

= Does it add tracking or analytics of its own? =

No. PixelSift does not track you, your visitors or your customers, and it does not load any external scripts.

= Will it change or remove my tags? =

No. PixelSift is read-only. It never changes, disables or removes other plugins, themes or tags. It reports what it finds, tells you how to fix it and links to the right settings screen. You make the change in the plugin, theme or tag manager that adds the tag.

= Will it slow down my store? =

No. PixelSift runs one background scan shortly after activation (through WP-Cron). After that, scans run only when you start one from the admin screen or WP-CLI. There are no recurring scans. A scan loads five pages from your own server, one after another. Nothing is added to the pages your visitors see; the extra attribution work only runs on the scanner's own requests, which carry a one-time token.

= Which pages does it scan? =

The home page, a product page, the cart page, the checkout page and the order-received page of your own store. The product page is your newest published, visible, in-stock simple product (or any published product if there is none). To see the cart and checkout as a shopper would, the scanner adds that product to a temporary guest cart, and deletes that cart session when the scan ends. The order-received page is loaded without an order, so purchase events are worked out from your tracking plugins' settings and from the plugins hooked into order completion. If your store has no products, the product page is skipped and the cart and checkout are scanned empty.

= Do I still need GTM4WP, PixelYourSite, Site Kit or Meta for WooCommerce? =

Yes, if you use them. PixelSift does not install tags. It checks that the tags those plugins add are not duplicated or misconfigured.

= My store uses a cookie or consent banner. Will results be accurate? =

Many consent tools leave the tag in the page but switch it off until consent (for example as `type="text/plain"`). PixelSift still finds those tags. Tags that a consent tool injects only after consent, and that are not in the page code at all, will not appear in a scan. Treat a "missing tag" or "no purchase event" finding on a consent-managed store as something to check by hand. PixelSift 0.1.2 has not yet been tested against specific consent plugins.

= What is a "Universal Analytics leftover"? =

Universal Analytics (UA-XXXXX-Y IDs) stopped processing data in 2023 (2024 for Analytics 360). Old UA snippets still on your pages add page weight and no data. PixelSift lists them so you can remove them.

= What data does the plugin store? =

Only the latest scan result (the tags found, findings, score and short code excerpts as evidence) is stored, in one WordPress option (`pixelsift_report`). The list of findings you marked as reviewed is stored in a second option. Each new scan replaces the previous result. No visitor or customer data is stored. Deleting the plugin from the Plugins screen removes all of its options, transients and scheduled events.

= Is there a paid version? =

No. PixelSift for WooCommerce is free forever. Every feature is included. There is no paid tier, subscription, or hosted upsell, and this version contains no code that connects to any paid service.

= Is PixelSift made by WooCommerce, Google or Meta? =

No. It is an independent tool and is not affiliated with or endorsed by Automattic, WooCommerce, Google or Meta.

== Screenshots ==

1. Report overview: the health score, findings counted by severity, and the first findings with their fix steps.
2. The same GA4 measurement ID set up by two plugins (Site Kit by Google and Google Analytics for WooCommerce), with fix steps and the evidence showing where it was found.
3. Plugin conflict: the purchase event sent by two plugins to the same GA4 ID, with a link to the setting to change in each plugin.
4. The same Meta Pixel added by PixelYourSite and by hand-added code in a must-use plugin, with fix steps and evidence.
5. Pages scanned and the score breakdown, showing the points each finding costs.
6. A clean result: score 100, no open findings, and the tags found on each page.

== Changelog ==

= 0.1.2 =
* New name: PixelSift for WooCommerce (slug and text domain pixelsift-for-woocommerce). Settings and report storage use the new pixelsift_ prefix.
* Script ownership detection now uses WordPress location functions (plugins_url(), get_theme_root_uri(), includes_url(), admin_url()) instead of hardcoded folder names, so sites with custom content or plugin directories are attributed correctly.

= 0.1.1 =
* Removed the "preparing its first scan" notice from admin screens other than PixelSift. The report page already says when no scan has run.
* Added direct-access protection to the vendored shared-rules evaluator while preserving standalone CLI evaluation.
* Added JSON report export and report reset actions in WooCommerce > PixelSift, plus quick action links on the Plugins screen.
* Declared WooCommerce HPOS and Cart/Checkout Blocks compatibility.

= 0.1.0 =
* Initial release.
* Scans the home, product, cart, checkout and order-received pages for GA4/gtag, Google Tag Manager, Meta Pixel, Google Ads, TikTok, Pinterest and Microsoft UET tags, and Universal Analytics leftovers.
* Shows which plugin, theme or snippet adds each tag.
* Flags overlaps between Site Kit by Google, GTM4WP, PixelYourSite, Meta for WooCommerce and Google Analytics for WooCommerce.
* WP-CLI commands: `wp pixelsift scan` and `wp pixelsift report`.
* 0–100 health score with fix guidance for every finding.
* No external calls by default.

== Upgrade Notice ==

= 0.1.2 =
Plugin renamed to PixelSift for WooCommerce; more reliable plugin and theme attribution on sites with custom folder locations.

= 0.1.1 =
WordPress.org compliance, WooCommerce HPOS/Blocks compatibility declaration, and JSON report export.

= 0.1.0 =
First public release. Read-only scanner; makes no external calls.
