All-in-one CAPI for Meta & Pinterest + GTM

Beskrivelse

Server-side tracking for your WooCommerce store — without a GTM Server Container, without a premium plugin, without a monthly bill.

This plugin sends Meta (Facebook) and Pinterest Conversions API events from your WordPress server, and sets up a clean GTM dataLayer so your browser-side tags (Pixel, GA4, Pinterest Tag) work alongside it. Same event ID on both sides, so Meta merges them into one event instead of double-counting.

What it does:

  • Meta & Pinterest CAPI — PageView, ViewContent, AddToCart, InitiateCheckout, Purchase, Search, AddToWishlist, Lead, and the full checkout funnel (AddShippingInfo, AddPaymentInfo). Sent server-side with hashed user data for high Event Match Quality.
  • GTM dataLayer — Automatic script injection and a standards-compliant dataLayer for GA4, Meta Pixel, Pinterest Tag, or anything else you run through GTM.
  • Full WooCommerce coverage — 14 event types, classic checkout and block checkout, HPOS compatible.
  • Cache-safe — Works with LiteSpeed Cache, WP Rocket, Varnish, and Cloudflare full-page cache. Events carry a unique random ID per visit so Meta never deduplicates cached traffic into one event.
  • Batch delivery — Events are queued and sent in bulk every 60 seconds. No synchronous HTTP on user requests, no latency added to page loads.
  • Built-in debug log — See exactly which events were sent, to which platform, and whether the API accepted them. Filterable by event type, with success/failure stats.
  • REST + AJAX fallback — Browser events go to a REST endpoint (no nonce, cache-proof) and fall back to admin-ajax.php if REST is blocked by a firewall.

What you don’t need:

  • No GTM Server Container (saves $30-150/month in cloud fees)
  • No premium tier — every feature is in the free plugin
  • No external tracking SaaS subscription

Please check the installation page for the recommended GTM settings for deduplication.

Our Philosophy

This plugin is free. Not “free with limits” — just free. Every feature works, no pro version behind a paywall.

I built it because setting up server-side tracking shouldn’t require a cloud engineering degree or a monthly bill. If it helps your store, that’s good enough.

External Services

This plugin connects your website to external services to send event data.

  • Service Used: Meta Conversion API
    • Purpose: To send user interaction and e-commerce event data from your server to Meta’s servers for ad performance measurement, optimization, and audience building.
    • Data Sent: Event details (product ID, price) and user parameters (IP address, user agent, hashed email/name/phone, Facebook cookies) are sent when a user performs a key action.
  • Service Used: Pinterest Conversions API
    • Purpose: Same as the Meta CAPI, providing reliable tracking for ad performance and audience building on Pinterest.
    • Data Sent: Event details and hashed user parameters are sent upon user action.
  • Service Used: Google Tag Manager
    • Purpose: To load a JavaScript container from Google’s servers that allows you to manage and deploy marketing and analytics tags.
    • Data Sent: The plugin provides your GTM Container ID to Google to fetch the correct script. GTM itself may collect data based on how you configure your tags.

Installation

  1. Upload the plugin folder to the /wp-content/plugins/ directory and activate it.
  2. Navigate to the Meta CAPI & GTM page from your main WordPress menu.
  3. Enter your GTM Container ID to inject the GTM script on your site.
  4. Enter your Meta Pixel ID and API Access Token for the server-side connection. Do the same for Pinterest if applicable.
  5. Go to the “Event Management” tab to select which CAPI events you want to track.
  6. Configure your GTM container using the instructions in the “Recommended GTM Setup” section below.

Recommended GTM Setup

Crucial First Steps:

To prevent duplicate events and ensure data accuracy, you must configure two settings in your Meta account and GTM container.
1. Turn Off Meta’s Automatic Event Tracking:
* In your Meta Business Suite, navigate to Events Manager and select your Pixel.
* Go to the Settings tab.
* Scroll to the Event Setup section and turn Off the toggle for Track Events Automatically Without Code. This plugin will handle all event sending.

  1. Pause Automatically Created GTM Tags:
    • In your GTM container, please pause or delete any automatically created tags that start with FB_. Since we will be creating our own tags manually, only they should be active.

TEMPLATE SETUP

To save time and prevent errors, we have created a GTM container template. You can import this file to automatically create all the necessary variables, triggers, and tags.

Step 1: Download the Template

Go to the “Meta CAPI & GTM” settings page in your WordPress admin panel. In the Main Settings tab, you will see a highlighted box with a link to download the gtm-template.json template file. Download this file to your computer.

Step 2: Import the Template into GTM

  1. Go to your Google Tag Manager container.
  2. Navigate to the Admin section.
  3. Click on Import Container.
  4. Click Choose container file and select the gtm-template.json file you downloaded.
  5. Choose a New workspace and give it a descriptive name (e.g., “CAPI Import”).
  6. IMPORTANT: Choose the Merge import option. Do NOT choose “Overwrite”, as this could delete your existing tags.
  7. The preview screen will show you all the new tags, triggers, and variables that will be added. Click Confirm.

Step 3: Configure Your IDs

After the import is complete, you must update the placeholder IDs with your own tracking IDs.

  1. Go to the Variables section.
  2. Find and click on the “CONST – Meta Pixel ID” variable.
    • Replace META_PIXEL_ID with your actual Meta Pixel ID.
    • Save the variable. All Meta tags will automatically use this value.
  3. Go to the Tags section.
  4. Find and click on the “GA4 – Google Tag (Configuration)” tag.
    • Replace GA4_MEASUREMENT_ID with your actual GA4 Measurement ID (e.g., G-XXXXXXXXXX).
    • Save the tag.
  5. Find and click on the “Pinterest – PageView” tag.
    • Replace PINTEREST_TAG_ID with your actual Pinterest Tag ID.
    • Save the tag.

Step 4: Publish

Once you have updated your IDs, click the Submit button in the top right corner, then Publish your container. Your GTM setup is now complete!

If you prefer to configure Google Tag Manager manually, or if you encounter any issues with the template import, the following guide provides step-by-step instructions to get everything configured.

MANUAL SETUP

Step 1: Create GTM Variables

Create the following variables of the type Data Layer Variable.
* Variable Name: DLV - event_id
* Data Layer Variable Name: event_id
* Variable Name: DLV - ecommerce
* Data Layer Variable Name: ecommerce
* Variable Name: DLV - Hashed Email
* Data Layer Variable Name: user_data.email
* Variable Name: DLV - ecommerce.shipping_method
* Data Layer Variable Name: ecommerce.shipping_method
* Variable Name: DLV - ecommerce.payment_method
* Data Layer Variable Name: ecommerce.payment_method

Step 2: Create GTM Triggers

Create the following triggers using the Custom Event type.
* Trigger Name: CE - PageView Meta
* Event name: page_view_meta
* Trigger Name: CE - View Item
* Event name: view_item
* Trigger Name: CE - Add to Cart
* Event name: add_to_cart
* Trigger Name: CE - Begin Checkout
* Event name: begin_checkout
* Trigger Name: CE - Purchase
* Event name: purchase
* Trigger Name: CE - View Item List
* Event name: view_item_list
* Trigger Name: CE - View Cart
* Event name: view_cart
* Trigger Name: CE - Select Item
* Event name: select_item
* Trigger Name: CE - Add Shipping Info
* Event name: add_shipping_info
* Trigger Name: CE - Add Payment Info
* Event name: add_payment_info

Step 3: Create GTM Tags

A) Meta Tags (Facebook Pixel)

Install the “Facebook Pixel” template from the GTM Community Template Gallery. Create the following tags.
* Tag: Meta – PageView
* Event Name: PageView
* More Settings > Event ID: {{DLV - event_id}}
* Trigger: CE - PageView Meta

  • Tag: Meta – ViewContent

    • Event Name: ViewContent
    • Object Properties: {{DLV - ecommerce}}
    • More Settings > Event ID: {{DLV - event_id}}
    • Trigger: CE - View Item
  • Tag: Meta – AddToCart

    • Event Name: AddToCart
    • Object Properties: {{DLV - ecommerce}}
    • More Settings > Event ID: {{DLV - event_id}}
    • Trigger: CE - Add to Cart
  • Tag: Meta – InitiateCheckout

    • Event Name: InitiateCheckout
    • Object Properties: {{DLV - ecommerce}}
    • More Settings > Event ID: {{DLV - event_id}}
    • Trigger: CE - Begin Checkout
  • Tag: Meta – Purchase

    • Event Name: Purchase
    • Object Properties: {{DLV - ecommerce}}
    • More Settings > Event ID: {{DLV - event_id}}
    • Trigger: CE - Purchase
  • Tag: Meta – ViewCategory

    • Event Name: ViewCategory
    • Object Properties: {{DLV - ecommerce}}
    • More Settings > Event ID: {{DLV - event_id}}
    • Trigger: CE - View Item List
  • Tag: Meta – AddPaymentInfo

    • Event Name: AddPaymentInfo
    • Object Properties: {{DLV - ecommerce}}
    • More Settings > Event ID: {{DLV - event_id}}
    • Trigger: CE - Add Payment Info

B) Pinterest Tags

Prerequisite: Install the “Pinterest Tag” template from the GTM Community Template Gallery. You must also create the following Data Layer Variables for e-commerce data:
* DLV - ecommerce.value (Data Layer Variable Name: ecommerce.value)
* DLV - ecommerce.currency (Data Layer Variable Name: ecommerce.currency)
* DLV - ecommerce.items (Data Layer Variable Name: ecommerce.items)

Create the following tags:

  • Tag: Pinterest – PageView

    • Tag ID: Your Pinterest Tag ID
    • Hashed Email: {{DLV - Hashed Email}}
    • Event to Fire: page_visit
    • Custom Parameters: Name event_id, Value {{DLV - event_id}}
    • Trigger: CE - PageView Meta
  • Tag: Pinterest – ViewContent

    • Tag ID: Your Pinterest Tag ID
    • Hashed Email: {{DLV - Hashed Email}}
    • Event to Fire: pagevisit
    • Custom Parameters: Add event_id, value, currency, and contents with their corresponding variables.
    • Trigger: CE - View Item
  • Tag: Pinterest – AddToCart

    • Tag ID: Your Pinterest Tag ID
    • Hashed Email: {{DLV - Hashed Email}}
    • Event to Fire: add_to_cart
    • Custom Parameters: Add event_id, value, currency, and contents with their corresponding variables.
    • Trigger: CE - Add to Cart
  • Tag: Pinterest – InitiateCheckout

    • Tag ID: Your Pinterest Tag ID
    • Hashed Email: {{DLV - Hashed Email}}
    • Event to Fire: initiate_checkout
    • Custom Parameters: Add event_id, value, currency, and contents with their corresponding variables.
    • Trigger: CE - Begin Checkout
  • Tag: Pinterest – Purchase

    • Tag ID: Your Pinterest Tag ID
    • Hashed Email: {{DLV - Hashed Email}}
    • Event to Fire: checkout
    • Custom Parameters: Add event_id, value, currency, and contents with their corresponding variables.
    • Trigger: CE - Purchase
  • Tag: Pinterest – ViewCategory

    • Tag ID: Your Pinterest Tag ID
    • Hashed Email: {{DLV - Hashed Email}}
    • Event to Fire: viewcategory
    • Custom Parameters:
      • Name event_id, Value {{DLV - event_id}}
      • Name content_name, Value {{DLV - ecommerce.item_list_name}}
    • Trigger: CE - View Item List

C) Google Analytics 4 Tags

Prerequisite: Before you begin, make sure you have your Measurement ID (starts with G-) from your Google Analytics 4 property. You must also create the following Data Layer Variables:
* DLV - ecommerce.currency (Data Layer Variable Name: ecommerce.currency)
* DLV - ecommerce.value (Data Layer Variable Name: ecommerce.value)
* DLV - ecommerce.items (Data Layer Variable Name: ecommerce.items)
* DLV - ecommerce.transaction_id (Data Layer Variable Name: ecommerce.transaction_id)
* DLV - ecommerce.item_list_name (Data Layer Variable Name: ecommerce.item_list_name)

First, create the main configuration tag that loads GA4 on all pages.
* Tag: GA4 – Google Tag (Configuration)
* Tag Type: Google Analytics > Google Tag
* Tag ID: Your GA4 Measurement ID (e.g., G-XXXXXXXXXX)
* Important: Uncheck the “Send a page view event when this configuration loads” box. We will send it manually with the next tag.
* Trigger: All Pages

Next, create the event tags that will send data from the dataLayer to Google Analytics.
* Tag: GA4 – Event – PageView
* Tag Type: Google Analytics > GA4 Event
* Configuration Tag: Select your GA4 - Google Tag (Configuration) tag.
* Event Name: page_view
* Trigger: CE - PageView Meta

  • Tag: GA4 – Event – ViewItem

    • Tag Type: Google Analytics > GA4 Event
    • Configuration Tag: Select your GA4 - Google Tag (Configuration) tag.
    • Event Name: view_item
    • Event Parameters:
      • Parameter Name: currency, Value: {{DLV - ecommerce.currency}}
      • Parameter Name: value, Value: {{DLV - ecommerce.value}}
      • Parameter Name: items, Value: {{DLV - ecommerce.items}}
    • Trigger: CE - View Item
  • Tag: GA4 – Event – AddToCart

    • Tag Type: Google Analytics > GA4 Event
    • Configuration Tag: Select your GA4 - Google Tag (Configuration) tag.
    • Event Name: add_to_cart
    • Event Parameters:
      • Parameter Name: currency, Value: {{DLV - ecommerce.currency}}
      • Parameter Name: value, Value: {{DLV - ecommerce.value}}
      • Parameter Name: items, Value: {{DLV - ecommerce.items}}
    • Trigger: CE - Add to Cart
  • Tag: GA4 – Event – BeginCheckout

    • Tag Type: Google Analytics > GA4 Event
    • Configuration Tag: Select your GA4 - Google Tag (Configuration) tag.
    • Event Name: begin_checkout
    • Event Parameters:
      • Parameter Name: currency, Value: {{DLV - ecommerce.currency}}
      • Parameter Name: value, Value: {{DLV - ecommerce.value}}
      • Parameter Name: items, Value: {{DLV - ecommerce.items}}
    • Trigger: CE - Begin Checkout
  • Tag: GA4 – Event – Purchase

    • Tag Type: Google Analytics > GA4 Event
    • Configuration Tag: Select your GA4 - Google Tag (Configuration) tag.
    • Event Name: purchase
    • Event Parameters:
      • Parameter Name: transaction_id, Value: {{DLV - ecommerce.transaction_id}}
      • Parameter Name: currency, Value: {{DLV - ecommerce.currency}}
      • Parameter Name: value, Value: {{DLV - ecommerce.value}}
      • Parameter Name: items, Value: {{DLV - ecommerce.items}}
    • Trigger: CE - Purchase
  • Tag: GA4 – Event – ViewItemList

    • Tag Type: Google Analytics > GA4 Event
    • Configuration Tag: Select your GA4 - Google Tag (Configuration) tag.
    • Event Name: view_item_list
    • Event Parameters:
      • Parameter Name: item_list_name, Value: {{DLV - ecommerce.item_list_name}}
      • Parameter Name: items, Value: {{DLV - ecommerce.items}}
    • Trigger: CE - View Item List
  • Tag: GA4 – Event – ViewCart

    • Tag Type: Google Analytics > GA4 Event
    • Configuration Tag: Select your GA4 - Google Tag (Configuration) tag.
    • Event Name: view_cart
    • Event Parameters:
      • Parameter Name: currency, Value: {{DLV - ecommerce.currency}}
      • Parameter Name: value, Value: {{DLV - ecommerce.value}}
      • Parameter Name: items, Value: {{DLV - ecommerce.items}}
    • Trigger: CE - View Cart
  • Tag: GA4 – Event – SelectItem

    • Tag Type: Google Analytics > GA4 Event
    • Configuration Tag: Select your GA4 - Google Tag (Configuration) tag.
    • Event Name: select_item
    • Event Parameters:
      • Parameter Name: items, Value: {{DLV - ecommerce.items}}
    • Trigger: CE - Select Item
  • Tag: GA4 – Event – AddShippingInfo

    • Tag Type: Google Analytics > GA4 Event
    • Configuration Tag: Select your GA4 - Google Tag (Configuration) tag.
    • Event Name: add_shipping_info
    • Event Parameters:
      • Parameter Name: currency, Value: {{DLV - ecommerce.currency}}
      • Parameter Name: value, Value: {{DLV - ecommerce.value}}
      • Parameter Name: shipping_tier, Value: {{DLV - ecommerce.shipping_method}}
      • Parameter Name: items, Value: {{DLV - ecommerce.items}}
    • Trigger: CE - Add Shipping Info
  • Tag: GA4 – Event – AddPaymentInfo

    • Tag Type: Google Analytics > GA4 Event
    • Configuration Tag: Select your GA4 - Google Tag (Configuration) tag.
    • Event Name: add_payment_info
    • Event Parameters:
      • Parameter Name: currency, Value: {{DLV - ecommerce.currency}}
      • Parameter Name: value, Value: {{DLV - ecommerce.value}}
      • Parameter Name: payment_type, Value: {{DLV - ecommerce.payment_method}}
      • Parameter Name: items, Value: {{DLV - ecommerce.items}}
    • Trigger: CE - Add Payment Info

After creating all tags, submit and publish your GTM container.

FAQ

Does this plugin replace the Meta Pixel?

No, it works alongside it. The plugin sends server-side (CAPI) events, while GTM handles the browser-side Pixel. Both use the same event_id, so Meta merges them automatically without counting anything twice.

What is the difference between this and a GTM Server Container?

A GTM Server Container runs on Google Cloud and costs money every month. This plugin does the same job directly from your WordPress server — no extra infrastructure, no extra bill.

Does it work with page caching plugins (WP Rocket, LiteSpeed, etc.)?

Yes. PageView and ViewCategory events fire from JavaScript, so they work even on fully cached pages. Cart, checkout, and purchase pages are not cached by default.

What plugins are required?

WooCommerce. That’s it. If you use other GTM plugins (like Google Site Kit), disable their e-commerce features to avoid conflicts.

Is there a pro version?

No. Everything is included.

My events aren’t showing in Meta Events Manager. What’s wrong?

Check these in order:
1. Open your Event Log tab in the plugin settings. If events appear there with “Success (Meta)”, the plugin is sending them. If Meta isn’t receiving them, the problem is on Meta’s end — usually Pixel ID or Access Token mismatch.
2. If the log is empty after visiting your store, you likely have a JS optimizer (LiteSpeed / WP Rocket / Autoptimize) deferring the plugin’s tracking scripts. See next answer.
3. Check the admin notice on the plugin settings page — the plugin auto-detects your cache setup and shows exclude-list instructions.

I use LiteSpeed Cache. How do I configure it?

Go to LiteSpeed Cache Page Optimization JS Settings JS Defer Excludes and add these script IDs (one per line):
mcapi-pageview-init
mcapi-viewcontent-events
mcapi-viewcategory-events
mcapi-frontend-events
Then purge all cache.

I use WP Rocket. How do I configure it?

Go to WP Rocket File Optimization JavaScript Excluded JavaScript Files and add the same script IDs listed above for LiteSpeed. Then clear WP Rocket cache.

I use Autoptimize. How do I configure it?

Go to Autoptimize JS, CSS & HTML Exclude scripts from Autoptimize and add the same script IDs.

What about Cloudflare Rocket Loader?

The plugin adds data-cfasync="false" to its inline scripts, which Cloudflare Rocket Loader respects. No configuration needed.

Does it work with a block-based theme (e.g. Twenty Twenty-Five)?

Yes. The plugin’s tracking works with the WooCommerce Products block used by FSE themes.

Anmeldelser

Læs 1 anmeldelse

Bidragsydere & udviklere

“All-in-one CAPI for Meta & Pinterest + GTM” er open source-software. Følgende personer har bidraget til dette plugin.

Bidragsydere

Ændringslog

3.3.0

  • New: REST API endpoint /wp-json/mcapi/v1/event for cache-safe browser-side tracking. No nonce required, so events continue to fire on pages served from a 7-day LiteSpeed/Varnish/Cloudflare cache. Secured by strict same-origin check, per-IP rate limit (50/min), global rate limit (1000/min), 16 KB body cap, and event-name whitelist.
  • New: Inline bootstrap helper printed at top of <head> (priority 1). All three inline tracking scripts (PageView, ViewContent, ViewCategory) share one code path that tries REST first, falls back to admin-ajax.php with a hard-coded fallback nonce if REST is blocked by a WAF.
  • Improvement: Reliable retries — transient API failures (HTTP 5xx, 429, network timeouts) no longer drop events from the queue. They stay queued and retry on the next cron tick. Permanent failures (4xx) still drop to avoid infinite retries. Queue retention extended to 24 hours to cover longer API outages.
  • Improvement: ViewCart and ViewCategory events now respect the per-event enable checkboxes in settings. They were previously always-on.
  • Improvement: external_id is now SHA-256 hashed when sent to Meta (was sent plain, which hurt Event Match Quality).
  • Improvement: REST handler respects per-event enable checkboxes — prevents cached pages from sending events the merchant has turned off.
  • Improvement: Description rewritten to highlight cache compatibility, REST/AJAX dual path, and retry semantics.
  • Fix: Nested <form> in admin UI — “Refresh Log” button now actually submits (was silently dropped by browsers).
  • Fix: double-hash on Pinterest external_id (since it’s now hashed upstream) — passed through as-is.
  • Fix: REST rate limiter now reads the real client IP via CF-Connecting-IP / X-Forwarded-For / X-Real-IP headers. Previously, sites behind Cloudflare or a load balancer saw every visitor as the proxy’s IP and hit the per-IP 429 limit within seconds.
  • Fix: Phone numbers now normalized toward E.164 using the billing country (leading “0” stripped, country dial code prepended). A Turkish shopper typing “0532…” now correctly matches against Meta’s hashed phone index instead of being sent as an unmatched local-format number.
  • Improvement: Cron lock on the queue processor — prevents two overlapping cron ticks from re-processing the same batch (which would have caused duplicate events on slow API responses).
  • Improvement: Batch size is now filterable via mcapi_queue_batch_size — high-traffic stores can raise the 100-per-tick ceiling.
  • Improvement: AJAX handler emits nocache_headers() so Cloudflare and other upstream caches do not cache the POST response.
  • Improvement: Uninstall cleanup now removes all plugin transients (stats, log caches, rate-limit counters) and the optimizer-notice dismissal user meta.
  • Improvement: Safari ITP bypass — _fbp and _fbc cookies are re-written server-side on every request with a 90-day TTL, which iOS/macOS Safari does NOT cap to 7 days (only JS-written cookies are capped). Long-window attribution for iOS shoppers is restored; often the single biggest EMQ lift for stores with heavy iOS traffic.
  • Improvement: Guest external_id is now the cookie-backed UUID (not billing email) when an order is processed. Keeps the Meta user journey consistent across PageView AddToCart Purchase. Email is still sent separately in the em field, so Meta’s matching is unchanged.
  • Improvement: mcapi_guest_external_id cookie now HTTP-only, Secure (on HTTPS), SameSite=Lax, 1-year TTL.

3.2.6

  • Improvement: Added data-no-defer="1" and data-no-minify="1" attributes to inline scripts so LiteSpeed Cache and other aggressive optimizers don’t wrap them in type="litespeed/javascript" (which prevented the scripts from running).
  • Improvement: Plugin now detects LiteSpeed Cache, WP Rocket, Autoptimize, WP Fastest Cache, and W3 Total Cache, and shows a one-time admin notice on the settings page with exact exclude-list instructions.
  • Improvement: Full compatibility guide in the FAQ for cache/optimizer plugins.

3.2.5

  • Fix: PageView event_id now includes browser-generated random component + timestamp. Previously the event_id was a path hash only, so every visitor to a full-page-cached URL sent the same event_id to Meta — which deduplicated them into a single event and dropped 95%+ of PageViews on LiteSpeed/WP Rocket/Varnish/Cloudflare sites.
  • Fix: All JS-driven CAPI events (PageView, ViewContent, ViewCategory, SelectItem, AddShippingInfo, AddPaymentInfo) now send the real page URL as event_source_url instead of /wp-admin/admin-ajax.php. This was lowering Meta Event Match Quality (EMQ) scores and breaking attribution.
  • Fix: ViewContent now captures product data on woocommerce_before_single_product (before related-products/upsells render) instead of reading global $product in wp_footer (where it was often overwritten by the last related product in the loop). Meta was receiving wrong product IDs on product pages with related/upsell sections.
  • Fix: SelectItem click tracker no longer fires on unrelated clicks (menu, logo, footer, cart drawer). The DOM walk is now constrained to the clicked link’s product container, using theme-agnostic selectors that cover Astra, Flatsome, Divi, Elementor, Bricks, and the block theme Products block.
  • Fix: Removed the duplicate product-marker hook registration that injected 2 hidden spans per product in every shop loop. The SelectItem tracker now reuses the data-mcapi-product-data attribute already present on the add-to-cart button (no extra HTML output).
  • Fix: Rejected attempts to spoof event_source_url from cross-origin values — server now validates that the POST’ed URL matches the site’s host.
  • Improvement: Added data-cfasync="false" and data-no-optimize="1" attributes to all plugin inline scripts. These signal Cloudflare Rocket Loader, LiteSpeed Cache, WP Rocket, and Autoptimize not to defer or combine the scripts — helps events fire on sites with aggressive JS optimizers.
  • Improvement: Better block theme compatibility — events are tracked correctly on Twenty Twenty-Five and other FSE (block-based) themes that use the WooCommerce Products block.

3.2.4

  • Fix: ViewContent event moved to JavaScript/AJAX to survive full-page cache (Varnish, WP Rocket, LiteSpeed, Cloudflare). Previously, cached product pages would fire the event only once when the cache was generated — every subsequent visitor produced zero CAPI calls and duplicate event_ids.
  • Fix: AddToCart event_id now includes uniqid() alongside cart_item_key. Adding the same product twice no longer gets silently deduplicated by Meta (WooCommerce reuses cart_item_key when incrementing quantity on an existing cart item).
  • Improvement: SelectItem click detection is now theme-agnostic. Works with Flatsome, Divi, Elementor, Bricks, Astra, Oxygen, and any custom theme/page builder. The plugin injects a hidden product marker via woocommerce_before_shop_loop_item_title, and the JS walks up the DOM from the clicked link to find it — no hard-coded CSS class dependencies.

3.2.3

  • Architecture: AddToCart CAPI is now fired server-side from the woocommerce_add_to_cart hook for all flows (classic page-reload AND AJAX cart), instead of relying on frontend JS. This is what CAPI was designed for — reliable tracking immune to adblockers, tracker blockers, and theme incompatibilities. Maximum theme coverage.
  • Improvement: Browser-side dataLayer push for AJAX add-to-cart is now delivered via woocommerce_add_to_cart_fragments filter, which injects the push script into the AJAX response. Works on any theme that uses WooCommerce’s standard AJAX cart.
  • Improvement: Shared event_id between server-side CAPI and browser-side dataLayer push (based on cart_item_key), guaranteeing Meta deduplication.
  • Performance: All AJAX event handler calls now go through the batch queue instead of direct synchronous HTTP calls. Admin-ajax.php response times are no longer tied to Meta/Pinterest API latency.
  • Cleanup: Removed the legacy mcapi_ajax_fired_* session flag and DOING_AJAX skip logic that was causing events to be lost when JS AJAX was blocked.
  • Event Match Quality: Every woocommerce_add_to_cart trigger now reaches Meta/Pinterest, regardless of browser-side interference.

3.2.2

  • Fix: GTM template – Meta tags now correctly use eventName: "standard" + standardEventName parameters. Previously all browser-side events were sent as PageView because the Facebook Pixel community template requires a radio button selector, not a direct event name.
  • Fix: GTM template – Pixel ID now uses a shared constant variable (CONST - Meta Pixel ID) instead of referencing a tag name, which GTM cannot resolve.
  • Improvement: GTM template setup simplified — users only need to update one variable for all Meta tags.

3.2.1

  • Fix: PageView event now fires correctly on first page load — dataLayer push no longer blocked by deferred script loaders (WP Rocket, LiteSpeed, etc.). Meta Pixel Helper will detect the pixel immediately.
  • Fix: GA4 product price field renamed from item_price to price to match GA4 standard. Fixes zero revenue in GA4 Item Revenue reports.
  • Fix: Real client IP detection for sites behind Cloudflare, AWS CloudFront, or Nginx reverse proxy. Improves Meta Event Match Quality (EMQ) scores.
  • Fix: Resolved plugin check warnings for unescaped DB parameters and missing translators comments.

3.2.0

  • Improvement: Updated Meta Graph API from v21.0 to v25.0 for continued compatibility.
  • Improvement: Meta API access token now sent via Authorization header instead of URL parameter (security best practice).
  • Fix: Fixed Pinterest CAPI event mapping – ViewContent now correctly maps to view_content instead of page_visit.
  • Fix: Fixed Pinterest CAPI ViewCategory event – now uses native view_category event instead of search.
  • Fix: Fixed Pinterest CAPI custom_data field names to match official API spec (contents instead of line_items, correct sub-field names).
  • Fix: Added Pinterest CAPI mappings for add_payment_info and view_category events.
  • Fix: Fixed GTM container template (broken JSON due to trailing comma and 10 malformed GA4 variable references). Template import now works correctly.
  • Security: Fixed all output escaping issues flagged by WordPress Plugin Check.
  • Security: Improved input sanitization and wp_unslash handling for cookies and POST data.
  • Security: Restructured admin request handlers to verify nonces before accessing POST data.
  • Standards: Renamed global functions to use the mcapi_ prefix per WordPress naming conventions.
  • Standards: Added translators comments for all translatable strings with placeholders.
  • Standards: Added proper phpcs:ignore annotations for legitimate direct database operations.
  • Standards: Added version parameter to enqueued scripts.
  • Standards: Fixed uninstall.php with ABSPATH check and prefixed global variables.
  • Performance: CAPI events are now queued in a database table and sent in batches every 60 seconds. A single HTTP request can carry up to 100 events, reducing server load by ~98% on high-traffic sites. Falls back to synchronous if the queue table is unavailable.
  • Improvement: Added block checkout compatibility for AddShippingInfo and AddPaymentInfo events. These now fire correctly on both classic and block-based WooCommerce checkout.
  • Improvement: Block checkout user data capture (billing info) now works for improved Event Match Quality.
  • Improvement: Added WooCommerce HPOS (High-Performance Order Storage) compatibility declaration.
  • Improvement: Enhanced event log – failures now show platform name (Meta/Pinterest) and all event types are filterable.
  • Improvement: Event statistics table now includes PageView and Search metrics.
  • Improvement: Added jQuery as explicit script dependency for frontend events.
  • Improvement: Removed review and donation prompts from the admin panel for a cleaner UI.
  • Improvement: Added WooCommerce version headers to readme.txt.
  • Improvement: Dataset quality report now dynamically uses the current plugin version.
  • Fix: PageView and ViewCategory CAPI events now fire via JavaScript AJAX, making them compatible with full-page cache (Varnish, Redis, Cloudflare).
  • Fix: Sanitization function now preserves numeric data types (float/int) instead of converting to strings, preventing API event rejections.
  • Fix: Added WooCommerce dependency check – shows admin notice instead of fatal error if WooCommerce is deactivated.
  • Fix: Log clearing now uses DELETE instead of TRUNCATE for compatibility with restricted database permissions on shared hosts.
  • Fix: Added composite database index (event_name, event_time) for faster log queries on high-traffic sites.

3.1.1

  • Fix: Minor bug fixes and stability improvements.

3.1.0

  • Major Feature: Added detailed tracking for checkout funnel steps: ‘Add Shipping Info’ and ‘Add Payment Info’ events for deeper analysis of cart abandonment.
  • Major Feature: Added ‘Select Item’ event tracking for analyzing product clicks from category and shop pages.
  • Major Feature: Added a new admin setting to choose the Product Identifier for events (SKU with fallback to ID, or ID Only), making the plugin flexible for stores without SKUs.
  • Improvement: Significantly enriched Pinterest CAPI user data to improve match rates, mirroring the data sent to Meta.
  • Improvement: Corrected Pinterest CAPI event mapping for ‘InitiateCheckout’ to improve funnel accuracy.

3.0.0

  • Major Improvement: Enriched the ‘view_item_list’ (Category View) event for GA4, now including the full list of products displayed on the page for advanced analytics.
  • New Feature: Added comprehensive tracking for the ‘remove_from_cart’ event, providing deeper insights into cart abandonment.
  • New Feature: Added tracking for the ‘login’ event to the dataLayer for GA4 and CAPI.
  • Improvement: Enriched the ‘Purchase’ event dataLayer with coupon codes, payment method, and shipping method details.
  • Improvement: Enhanced the Pinterest CAPI ‘add_to_cart’ event to include detailed product line items, improving data quality.
  • Security: Hardened the AJAX event handler with recursive sanitization for all incoming data, improving overall security.

2.9.0

  • Improvement: View Category and GA4 settings

2.8.0

  • Fix: Pinterest external_id and click_id.

2.7.0

  • Fix: Duplicate pageview fix.

2.6.0

  • Fix: Pinterest line_items fix.

2.5.0

  • Fix: AddToCart fix.

2.4.0

  • Fix: Pinterest data format fix.

2.3.0

  • Major Feature: Full Pinterest Conversions API (CAPI) and Pixel integration.
  • Improvement: Added a robust AJAX-based tracking method for the ‘AddToCart’ event to ensure it fires correctly with all themes and caching systems.
  • Improvement: Enhanced ‘PageView’ event tracking with a dedicated dataLayer push to ensure perfect deduplication between browser and server events.
  • Improvement: Redesigned the admin panel by merging Meta and Pinterest settings into a unified tab.
  • Improvement: Enhanced the event log to display the platform (Meta/Pinterest) for each successful event.
  • Improvement: Added a manual “Refresh Log” button to the admin panel to bypass caching and view real-time event data.
  • Housekeeping: General code refinements and WordPress standards alignment for repository submission.

2.2.0

  • Improvement: Developments for improved Event Match Quality.

2.1.0

  • Security: Added nonce checks for admin forms to prevent CSRF vulnerabilities.
  • Security: Implemented late escaping for all echoed variables in the admin panel to prevent XSS.
  • Security: Hardened database queries by ensuring all parts of the query are properly prepared.
  • Security: Sanitized all $_SERVER superglobal inputs to prevent potential injection issues.
  • Documentation: Added a required “External Services” section to the readme.txt to disclose the use of the Meta Conversion API.
  • Housekeeping: Bumped version number.

2.0.0

  • Major Feature: Added Google Tag Manager (GTM) container script injection. The plugin is now an all-in-one solution.
  • Major Feature: Unified Data Layer for both CAPI and GTM to enable flawless event deduplication.
  • Improvement: Added a GTM Container ID field to the admin settings.
  • Housekeeping: Updated plugin name and description to reflect new GTM capabilities.

1.8.0

  • Feature: Added first name, last name, and phone hashing (fn, ln, ph) for improved Event Match Quality.

1.7.0

  • Improvement: Enhanced overall security.

1.6.0

  • Improvement: Updated admin panel UI/UX for better usability.

1.5.0

  • Feature: Added Dataset Quality API report submission on Pixel ID change.

1.4.0

  • Feature: Added server-side PageView event tracking.

1.3.0

  • Improvement: Optimized performance of event tracking hooks.

1.2.0

  • Security: Hardened database queries and improved input sanitization.
  • Standardization: Added full translation support and aligned code with WordPress.org best practices.

1.1.0

  • Feature: Added dashboard with event statistics.

1.0.0

  • Initial public release.