Documentation Fundamentals

The add_to_wishlist Event in Google Analytics 4 (GA4)

The add_to_wishlist event in Google Analytics 4 (GA4) is used to track when a user adds a product to their wishlist or favorites.

This is particularly valuable when users don’t buy immediately but return later (e.g., for fashion, furniture, high-ticket items, or when browsing a large selection). A wishlist action is often a strong “I want this, but not right now” signal.

Screenshot of the heart icon on Taschen's product detail page
The small heart button on Taschen's product detail page to save a product for later

The add_to_wishlist event is one of the e-commerce events in GA4, meaning it can be enriched with items. You can optionally include value and currency if you want to analyze wishlist values.

Implementation

The best place to trigger add_to_wishlist is the moment when the item has actually been saved to the wishlist (after a successful API response or state update).

Required fields & value logic

  • items is required. Each item should have at least item_id or item_name set.
  • If you use value, also set currency. value should be the sum of price * quantity for the added wishlist items (excluding shipping/taxes—just like other e-commerce events).

dataLayer

javascript
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
    event: "add_to_wishlist",
    ecommerce: {
        currency: "EUR",
        value: 19.90,
        items: [{
            item_id: "SKU12345",
            item_name: "V-Neck T-Shirt",
            item_category: "T-Shirts",
            item_variant: "Black",
            item_brand: "MyFashion",
            price: 19.90,
            quantity: 1
        }]
    }
});
Show all code

Common pitfalls

  • Login required: Many wishlists require a login. If you redirect users to log in when they click the button, only track add_to_wishlist after the item has been successfully saved.
  • Toggle buttons: If the same button handles both “add” and “remove,” make sure you cleanly distinguish between add_to_wishlist and a potential remove_from_wishlist event.