Solution: How to fire FB Pixel and Conversion API events with Shopify Buy Button on a Wordpress Site

So this is a work-around but it works perfectly fine. If you have Shopify Buy Buttons on an external wordpress site and want them to fire FB Pixel Events like AddToCart you can do the following:

  1. Set-Up Google Tag Manager on your website.

  2. Set up a Trigger in GTM with “CSS Selector Visibility” and the Selector of the Cart that opens on a Buy Button Click (see screenshot).

  3. Let the GTM trigger fire a Mouseover Event with JS on an Element with a class or id e.g. “atcclick” (see screenshot).

  4. Set up a little Element in your website’s footer with that class or id e.g.

    .

  5. Set up “PixelYourSite” Plugin for Wordpress

  6. Let PixelYourSite interpret that Mouseover as an AddToCart (see screenshot).

  7. Now you’ll get deduplicated AddToCart conversion events through browser and ConversionAPI.

Optionally you can let the Trigger in GTM fire a plain FB Pixel AddToCart event directly in GTM, no need for Step 3 to 6 BUT this will only fire browser events and nothing through Conversion API.

PS: Why a MouseOver instead of a Click event for PixelYourSite? Well a click works as well, but the click you are triggering closes the cart again – making it impossible to open the cart.

GTM Trigger:

GTM Tag:

Event in PixelYourSite:

1 Like