Skip to content

Pixel events (Meta, Google Analytics 4)

Plan: Pro and up.

On Pro and Premium, Cove publishes wishlist actions as Shopify customer events: saves, removals, share links and back-in-stock signups. Any pixel on your store can listen to them. With the custom pixel below, every wishlist save reaches Meta as AddToWishlist and Google Analytics 4 as add_to_wishlist, so you can build audiences and measure campaigns on them.

There’s nothing to switch on in Cove: on Pro and up the events are published as soon as the app embed is on. You only add the pixel that forwards them.

Why Shopify’s own Meta and Google pixels don’t send them

Section titled “Why Shopify’s own Meta and Google pixels don’t send them”

Shopify’s Facebook & Instagram and Google & YouTube apps send Shopify’s standard events only (page views, product views, add to cart, checkout). Wishlist saves are custom events, which those apps don’t forward on their own. A custom pixel does: it runs in Shopify’s pixel sandbox, subscribes to Cove’s events and sends them on.

  1. In Cove, go to Settings › Analytics & integrations. In the Integrations section, click Copy pixel code. (You can also copy it from the code block below.)
  2. In your Shopify admin, go to Settings › Customer events and click Add custom pixel. Name it “Cove Wishlist”.
  3. Under Customer privacy, require Marketing and Analytics permission, as you would for any ads pixel.
  4. Paste the code. Replace YOUR_META_PIXEL_ID with your Meta Pixel ID and G-XXXXXXXXXX with your GA4 measurement ID. If you use only one of the two, delete the other half.
  5. Set CATALOG_COUNTRY to your catalog’s country (see matching your ads catalog).
  6. Click Save, then Connect.
  7. Save a product on your store, then check it arrived: the Meta Pixel Helper (AddToWishlist), GA4 DebugView (add_to_wishlist) or the Test button on the pixel in Shopify.

Below Pro, the Copy pixel code button is shown disabled with the plan’s name.

// Cove Wishlist → Meta Pixel and Google Analytics 4.
// Settings › Customer events › Add custom pixel. Paste this, replace the
// two IDs, and delete the half you don't use.
const META_PIXEL_ID = 'YOUR_META_PIXEL_ID';
const GA4_MEASUREMENT_ID = 'G-XXXXXXXXXX';
// Your catalog's ID for a saved item, so the event matches your ads catalog.
// Catalogs synced by Shopify's Facebook & Instagram and Google & YouTube
// apps usually use shopify_<COUNTRY>_<product ID>_<variant ID>: set your
// catalog's country, or return variantId if your catalog uses variant IDs.
const CATALOG_COUNTRY = 'US';
function catalogId(productId, variantId) {
return variantId
? 'shopify_' + CATALOG_COUNTRY + '_' + productId + '_' + variantId
: productId;
}
function loadScript(src) {
const script = document.createElement('script');
script.async = true;
script.src = src;
document.head.appendChild(script);
}
// Meta Pixel (Meta's base code, written out).
const fbq = (window.fbq = function () {
fbq.callMethod ? fbq.callMethod.apply(fbq, arguments) : fbq.queue.push(arguments);
});
fbq.push = fbq;
fbq.loaded = true;
fbq.version = '2.0';
fbq.queue = [];
loadScript('https://connect.facebook.net/en_US/fbevents.js');
fbq('init', META_PIXEL_ID);
// Google tag. No page view: your Google channel already sends those.
window.dataLayer = window.dataLayer || [];
function gtag() {
window.dataLayer.push(arguments);
}
loadScript('https://www.googletagmanager.com/gtag/js?id=' + GA4_MEASUREMENT_ID);
gtag('js', new Date());
gtag('config', GA4_MEASUREMENT_ID, { send_page_view: false });
analytics.subscribe('cove_item_added', (event) => {
const { productId, variantId } = event.customData;
const id = catalogId(productId, variantId);
fbq('track', 'AddToWishlist', {
content_ids: [id],
content_type: 'product',
});
gtag('event', 'add_to_wishlist', {
items: [{ item_id: id }],
});
});

The pixel loads its own copy of each tag inside Shopify’s sandbox and sends no page views, so nothing your other pixels already send is counted twice.

For Meta and Google to tie a save to a product in your ads catalog, the ID must match the catalog’s. Catalogs synced by Shopify’s Facebook & Instagram and Google & YouTube apps usually use shopify_<COUNTRY>_<product ID>_<variant ID>, which is what catalogId builds when a variant was saved: set CATALOG_COUNTRY to your catalog’s country code. If your catalog uses plain variant IDs, change catalogId to return variantId. A save from a product card has no variant, so it sends the product ID.

The same analytics.subscribe pattern works for the other three events, and for any service your pixel can reach. For example:

// Added at the end of the pixel above, which defines gtag.
analytics.subscribe('cove_list_shared', event => {
const { listId, method } = event.customData;
gtag('event', 'share', { method: method, content_type: 'wishlist' });
});
Event When What it contains
cove_item_added A shopper saved a product or variant. productId, variantId (or null for a product save), listId, source
cove_item_removed A shopper removed one. productId, variantId, listId (null for a removal from every list), source
cove_list_shared A shopper copied their share link, sent it from the share sheet or opened the email link. listId, method (copy, native or email)
cove_notify_subscribed A shopper’s back-in-stock email alert went live. A guest who still has to confirm it by email isn’t counted. productId, variantId (the sold-out variant)

source says where a save or removal happened: product_button (the product page button or <cove-button>), card_heart, list_sheet (the “Change” list picker), wishlist_page, undo, cart_save (Save for later in the cart) or api (your theme’s own code). Field by field details are in Events.

Product, variant and list IDs and where the action happened, nothing more. No event carries an email address, a customer ID, a guest token, a share link or anything the shopper typed, and back-in-stock signups never include the email address. Like every pixel, your custom pixel runs only with the consent your store’s customer privacy settings require.

Cove installs no pixel of its own: that would need permission to write your store’s pixel settings, and Cove asks for no write access to your store’s data. See security.

The events are published only while your plan includes them. After a downgrade below Pro, the app embed stops loading the events script once the new plan reaches your storefront (the next time the app is opened in your admin, or the nightly plan check), so your custom pixel simply receives nothing. Nothing is deleted: upgrade again and the same pixel starts receiving events. See changing plans.