Skip to content

Events

Plan: DOM events (cove:change, cove:ready) on every plan, including Free. Pixel events are Pro and up.

Cove tells your code about wishlist changes in two ways:

  • DOM events on document, for your theme’s own scripts on the same page.
  • Pixel events, published as Shopify customer events, for pixels (Meta, Google Analytics 4 and others) that run in Shopify’s pixel sandbox.

Fires once on document when Cove’s storefront script has set up. From then on window.CoveWishlist exists. Use it when your code may run before Cove’s deferred script (see JavaScript API).

Fires on document after every save, removal and sync, whatever made it: a product button, a card heart, the list picker, Undo, Save for later in the cart, a custom element or a window.CoveWishlist call.

document.addEventListener('cove:change', event => {
const { count, action, productId } = event.detail;
document.querySelector('#my-count').textContent = String(count);
});

event.detail:

Field What it holds
items The saved items after the change: { productId, variantId, listIds } each, as window.CoveWishlist.get() returns them.
count Saved products and variants after the change. An item in two lists counts once.
action add, remove or sync.
productId The product saved or removed, as a string. null on a sync, except a move between lists, which carries the moved product.
variantId On an add or removal: the variant, or empty/null/absent for a product-level save.
listId On an add or removal: the list it was saved to or removed from. Absent for a one-tap save (which goes to the default list) and for a removal from every list.
source Which Cove control made the change. Absent for a window.CoveWishlist call. Its raw values are internal; the pixel events translate them into the stable names listed below.

action is:

  • add: an item was saved.
  • remove: an item was removed.
  • sync: the state was refreshed or changed in some other way: the first load of a returning shopper’s wishlist, a guest list merged into the account at sign-in, an item moved between lists, or a list created, renamed, deleted or shared.

The event fires only after the server has confirmed the change, so items and count are what Cove now holds. A refused save fires nothing.

On Pro and up, Cove publishes wishlist actions as Shopify custom customer events with Shopify.analytics.publish. Any pixel on your store can subscribe to them: a custom pixel you add in Settings › Customer events, or an app pixel that listens for them. Like every pixel, they follow your store’s customer privacy settings.

Shopify’s Facebook & Instagram and Google & YouTube apps send Shopify’s standard events only, so they don’t forward these on their own. The pixel events guide has a ready-made custom pixel that sends saves to Meta (AddToWishlist) and GA4 (add_to_wishlist).

Event When
cove_item_added A shopper saved a product or variant.
cove_item_removed A shopper removed one.
cove_list_shared A shopper copied their share link, sent it from the share sheet or opened the email link.
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.

event.customData:

Field What it holds
productId Shopify product ID (string).
variantId Shopify variant ID, or null when the product was saved.
listId Cove’s opaque ID of the list, or null (a removal from every list). For an add without a named list, it’s the item’s list when it’s in exactly one; otherwise null.
source Where it happened (below).

source is one of:

source Where it happened
product_button The product page button (or <cove-button>).
card_heart A heart on a product card.
list_sheet The “Change” list picker after a save.
wishlist_page The remove button on the wishlist page.
undo Undo in the toast.
cart_save Save for later on a cart line (the item then leaves the cart).
api Your own code, through window.CoveWishlist.

Anything Cove doesn’t recognise is reported as other, so treat unknown values as such.

Field What it holds
listId Cove’s opaque ID of the shared list.
method copy, native (the device’s share sheet, not cancelled) or email.
Field What it holds
productId Shopify product ID.
variantId The sold-out variant.
analytics.subscribe('cove_item_added', event => {
const { productId, variantId, listId, source } = event.customData;
// Forward to the service of your choice.
});
analytics.subscribe('cove_list_shared', event => {
const { listId, method } = event.customData;
});

No event carries an email address, a customer ID, a guest token, a share link or anything the shopper typed. 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.

Only on Pro and Premium: the app embed adds the small events script only while your plan includes pixel events, so other stores load nothing extra. After a downgrade the events stop once the new plan reaches your storefront (the next time the app is opened in your admin, or the nightly plan check). They are published only on Online Store pages, where Shopify.analytics exists, and a pixel that throws never breaks the wishlist.

The same events feed the optional Klaviyo and Omnisend forwarding.