Google Analytics 4
How it works
When a customer clicks the wishlist heart, Stashlist checks for window.gtag on the page. If it's present, it calls:
gtag('event', 'add_to_wishlist', {
items: [{
item_id: '<variantId>',
item_name: '<productTitle>',
item_variant: '<variantTitle>',
price: <price>,
currency: '<storeCurrency>',
}],
}); This is a recommended GA4 e-commerce event, so it maps directly to GA4's standard reporting without any custom setup.
Setup
No setup is required in Stashlist. Just make sure GA4 is installed on your store through one of these methods:
- Shopify's Google & YouTube sales channel: the recommended approach. Installs GA4 automatically on every page.
- Google Tag Manager: if you manage tags via GTM, ensure the gtag.js base tag fires on all pages.
- Your theme: add the GA4 base snippet to
theme.liquiddirectly.
Once your GA4 tag is on the store,
add_to_wishlist events will appear in GA4's event reports automatically.
Verifying it works
- Open your store in Chrome and open DevTools → Console.
- Enable GA4 debug mode by running:
window.gtag('config', 'G-XXXXXXXX', { debug_mode: true }) - Click the wishlist heart on a product.
- In GA4 → Admin → DebugView, you should see an add_to_wishlist event appear within seconds.
Using the event in GA4
Once events are flowing, you can use add_to_wishlist in GA4 reports and explorations:
- Events report: Go to Reports → Engagement → Events to see
add_to_wishlistevent counts - Funnel exploration: Add
add_to_wishlistas a funnel step between product views and purchases to measure wishlist conversion rate - Audience builder: Create an audience of users who triggered
add_to_wishlistfor use in Google Ads remarketing
Google Ads remarketing: Import your GA4 audiences into Google Ads to retarget customers who wishlisted a product. This is a high-intent signal and typically converts at a significantly higher rate than standard site visitor audiences.