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.
Add the custom pixel
Section titled “Add the custom pixel”- 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.)
- In your Shopify admin, go to Settings › Customer events and click Add custom pixel. Name it “Cove Wishlist”.
- Under Customer privacy, require Marketing and Analytics permission, as you would for any ads pixel.
- Paste the code. Replace
YOUR_META_PIXEL_IDwith your Meta Pixel ID andG-XXXXXXXXXXwith your GA4 measurement ID. If you use only one of the two, delete the other half. - Set
CATALOG_COUNTRYto your catalog’s country (see matching your ads catalog). - Click Save, then Connect.
- 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.
The pixel code
Section titled “The pixel code”// 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.
Matching your ads catalog
Section titled “Matching your ads catalog”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.
Forwarding other events
Section titled “Forwarding other events”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' });});The events
Section titled “The events”| 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.
What’s never in an event
Section titled “What’s never in an event”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.
If you change plans
Section titled “If you change plans”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.
Related
Section titled “Related”- Klaviyo and Omnisend: the same events for your email platform.
- Settings: Analytics & integrations
- Events reference