Fixes · Wishlists and cookie consent

Wishlist hearts do nothing until the shopper accepts cookies

The fix

Wishlist apps such as Swym start only once the shopper has agreed to preference (functional) cookies. Until then the hearts are on the page with nothing behind them, so a tap does nothing.

Ask at the moment it matters: when a heart is tapped before the app has loaded, show a short prompt, record consent for preferences only through Shopify’s Customer Privacy API, then save the product. Never tell the app consent was given when it wasn’t.

01Why the hearts wait for consent

Shopify’s Customer Privacy API keeps each shopper’s answer for four purposes: analytics, marketing, preferences and sale of data. Apps that set cookies read it before they start. A wishlist remembers what someone saved, so wishlist apps such as Swym wait for preferences consent, which Shopify describes as “Cookies that remember customer preferences, such as country or language, to personalize visits to the website” (Shopify, Customer Privacy API).

“Swym relies on the consent status before allowing its standard cookie-based wishlist functionality to operate.”

So wherever your store asks for consent (Shopify’s own banner is active by default only in the UK, the EEA and other regions set up for it), three groups of shoppers get hearts that do nothing: people who declined, people who closed or ignored the banner, and people whose banner never appeared. The page looks normal, nothing shows an error, and the heart is still there to tap.

When the banner itself goes missing

Check the third group first. A banner that should show and doesn’t means nobody in that region can say yes, so the wishlist never works for them. On this Shopify Community thread (Jan 2025) a merchant’s banner stopped appearing and they suspected another script on the page; the replies check the region settings and send them to the theme developer, and the thread ends without a fix. On the store below, the script that hid the banner was one of ours.

The fix that looks right and isn’t

The API has a method, shouldShowBanner(), that returns true when consent “isn’t already set and the visitor is in a region showing consent”. Some wishlist loaders check it: no banner due, no consent needed, so the app starts. That makes a tempting shortcut. Override the method to return false, fire the consent event, and the hearts work.

Don’t. A consent app can read the same method to decide whether to show its banner, and on the store below it did, so the shortcut hid the banner from everyone it applied to. And every other script that listens for the consent event gets one with none of the details it expects. Shopify’s visitorConsentCollected event carries marketingAllowed, analyticsAllowed, preferencesAllowed and saleOfDataAllowed in its detail; a script that reads event.detail.marketingAllowed from a bare event throws an error and stops.

02Check the banner, then ask on the tap

For store owners

  1. Tap a heart with cookies declined

    Open the store in a private window, from a region where your banner shows. Decline the banner, or close it, and tap a heart. If nothing happens, this is your problem.

  2. Check the banner shows where it should

    In Shopify admin, open Settings > Customer privacy, then the cookie banner, and look at Regions (Shopify Help). If a consent app shows your banner instead, check its own region list too. Then visit as a new shopper from one of those regions: the banner should appear.

  3. Make sure shoppers can change their answer

    Shopify’s help says the link to a customer’s preferences is in your store’s policies section, and on the banner whenever it shows. A shopper who declined can then change their mind. Developers ask how to reopen the banner from their own link on this thread (in German, Feb 2024).

  4. Ask your wishlist app what it offers

    Before anyone builds anything. Consentmo’s guide to Swym describes an optional mode that keeps the wishlist on the shopper’s own device instead of in cookies, and a prompt that “may” ask for consent when a shopper uses a wishlist button. On the store below, the app’s consent prompt came in an embed that install didn’t offer.

For developers: ask on the tap

When the wishlist app hasn’t loaded and a heart is tapped, show a small prompt. “Allow and save” records preferences consent only and remembers which heart was tapped; when the app is ready, save that product. setTrackingConsent takes one or more signals at once, so preferences can go on its own (Shopify). Here is the shape of the fix we shipped, generalised:

A heart tapped before the wishlist has loadedjs
let pendingHeart = null;

document.addEventListener('click', (event) => {
  const heart = event.target.closest('[data-wishlist-heart]');
  if (!heart) return;
  event.preventDefault();

  if (window.wishlistReady) {
    toggleWishlist(heart);
    return;
  }

  withPrivacyApi((privacy) => {
    if (!privacy || !privacy.setTrackingConsent) return;
    if (privacy.preferencesProcessingAllowed()) {
      queueSave(heart); // consent is in, the app is still starting
      return;
    }
    showPrompt({
      message: 'To save favourites, we need your OK to use functional cookies.',
      allow: 'Allow and save',
      dismiss: 'Not now',
      onAllow: () => {
        queueSave(heart);
        privacy.setTrackingConsent({ preferences: true }, () => {});
      },
    });
  });
});

function withPrivacyApi(callback) {
  const shopify = window.Shopify;
  if (shopify && shopify.customerPrivacy) return callback(shopify.customerPrivacy);
  if (!shopify || !shopify.loadFeatures) return callback(null);
  shopify.loadFeatures(
    [{ name: 'consent-tracking-api', version: '0.2' }],
    (error) => callback(error ? null : window.Shopify.customerPrivacy),
  );
}

let pendingTimer = null;
function queueSave(heart) {
  pendingHeart = heart;
  clearTimeout(pendingTimer);
  pendingTimer = setTimeout(() => { pendingHeart = null; }, 15000); // the app never came
}

// Call this from the wishlist app's own "ready" callback.
function onWishlistReady() {
  window.wishlistReady = true;
  const heart = pendingHeart;
  pendingHeart = null;
  clearTimeout(pendingTimer);
  if (heart && document.contains(heart) && !isSaved(heart)) toggleWishlist(heart);
}
  • Grant preferences only. The shopper agreed to a wishlist, not to marketing or analytics.
  • Don’t start the wishlist app’s loader yourself. Shopify publishes visitorConsentCollected when consent changes, and an app that waits for consent can pick that up. On the store we fixed, the app loaded at once, with no reload.
  • Give up quietly if the app never arrives (a blocked script, a slow connection). Ours drops the pending save after 15 seconds.
  • Put the prompt’s words in the theme’s translations, so each language gets its own.
  • Never override shouldShowBanner() or dispatch visitorConsentCollected yourself.

03Decline, tap, and check nothing else changed

  1. Decline, then tap

    In a private window, decline the banner and tap a heart. The prompt should open. Choose allow: the heart should fill and the product should be in the wishlist, with no reload.

  2. Check nothing else changed

    In the browser console, Shopify.customerPrivacy.preferencesProcessingAllowed() should now be true, and Shopify.customerPrivacy.marketingAllowed() should still be false.

  3. Accept, then tap

    In a new private window, accept the banner. Hearts should save straight away, with no prompt.

  4. For developers: watch the console as consent changes

    Accept and decline the banner with the console open. No script should throw when the consent event fires.

From our work

04Our first fix was wrong, and what replaced it

On a beauty brand’s store we look after, selling in several countries, the hearts on its new theme did nothing for UK shoppers. The wishlist app waited for preferences consent, and the consent app was meant to ask for it.

The first fix (13 Aug 2026), and why it was wrong. We read the consent app’s settings as leaving the UK off its list of regions, so UK shoppers would never be asked and could never say yes. Our fix overrode shouldShowBanner() to return false for those shoppers and fired the consent event, so the wishlist would start. On the preview, the hearts worked.

What it cost. The premise was wrong: the consent app was set to show everywhere. It read the same method, so our override stopped the banner showing to UK shoppers at all. The bare consent event broke a tracking script that read its details, so that script’s update to Google’s consent never ran and Google consent stayed denied on every UK page view (gcs=G100). We found it on 10 Sep and took the override out that day. For about four weeks, UK visitors who landed on the new theme were never asked about cookies.

The real fix (6 Oct 2026). With the override gone, the hearts were dead again for anyone who hadn’t said yes. That is the correct state, so the fix had to come at the moment of asking. The consent app’s banner couldn’t be reopened from code on that store (its script API needs a higher plan, and its reopen trigger was off), and the wishlist app’s own consent prompt came in an embed that install didn’t offer. So a heart tapped before the wishlist has loaded now opens a short prompt: “To save favourites, we need your OK to use functional cookies.” “Allow and save” grants preferences only, the wishlist starts without a reload, and the tapped product is saved; on a product page, in the chosen size.

What we took from it: when an app waits for consent, the fix is to ask the shopper, never to tell the app consent was given.

The bigger picture

05Code that touches consent

A wishlist that waits for consent is doing the right thing. The risk is code that touches consent without anyone checking what else reads it: the banner, your tracking, Google’s consent signals. If consent work on your store was done in a hurry, or your banner doesn’t show where you expect, check what every script does before and after a shopper answers.

06Sources

Every step and claim above comes from one of these, or from the fix on the store it describes.

  1. Shopify developers: Customer Privacy API
  2. Shopify Help Center: Privacy settings (cookie banner regions and preferences)
  3. Consentmo: Consentmo and Swym integration (updated 24 Sep 2026)
  4. Shopify Community: cookie banner not showing up (Jan 2025)
  5. Shopify Community: Method to manually trigger the cookie consent banner (in German, Feb 2024)

Sources checked on .

Contact

Apps waiting on cookie consent?

Tell us which apps they are and which cookie banner your store runs.