> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loveful.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Analytics

> Send wishlist saves, removes, shares and wishlisted orders to your Google Analytics 4 property.

Loveful sends wishlist activity to your Google Analytics 4 (GA4) property, so it shows in your reports and can drive audiences. It's on every plan. Open it under **Settings › Integrations › Google Analytics**.

You need two things from your GA4 web stream: its **Measurement ID** and a **Measurement Protocol API secret**.

## Connect

**1. Open your web stream**

In Google Analytics, open **Admin**, then **Data collection and modification**, then **Data streams**, and choose your store's web stream.

**2. Copy the Measurement ID**

It's at the top of the stream details and starts with `G-`.

**3. Create an API secret**

In the same stream, open **Measurement Protocol API secrets** and click **Create**. Give it a nickname, such as Loveful, and copy the **Secret value**.

**4. Paste both into Loveful and save**

Enter them as **Measurement ID** and **API secret**. The secret is stored encrypted and only shown masked afterwards.

Events show in Google Analytics within a few minutes. To check, choose **Send test event**: Loveful sends an event called `loveful_test`, which you'll find under **Reports › Realtime**. If Google refuses it, Loveful shows the reason.

The page also shows when the last event was sent. To stop sending, choose **Disconnect**.

## Events

| Event | When it's sent |
| - | - |
| `add_to_wishlist` | A shopper saved a product to their wishlist. |
| `wishlist_item_removed` | A shopper removed a product from their wishlist. |
| `share` | A shopper shared their wishlist by link or email. |
| `wishlist_shared_view` | Someone opened a shared wishlist. |
| `wishlist_purchase` | An order included products the shopper had wishlisted. |

Saves use Google's own `add_to_wishlist` event and shares its `share` event, so GA4's standard reports and audiences understand them. The others are Loveful's own.

### What each event carries

* **`add_to_wishlist`** and **`wishlist_item_removed`**: the product as a GA4 item (`item_id` is the variant ID, plus `item_name`, `item_variant` and `price`), `currency`, `value` (the product's price), `product_id` and `wishlist_total_count`.
* **`share`**: `method` (`link` or `email`), `content_type` (`wishlist`) and `item_count`. The share link itself is never sent, because it opens the shopper's wishlist for anyone who has it.
* **`wishlist_shared_view`**: `item_count`.
* **`wishlist_purchase`**: `transaction_id` (the order ID), `currency`, `value` (the wishlisted items' total) and the wishlisted lines as `items`, with their quantities and prices.

Every event is linked to the shopper's visit in GA4, so it keeps the visit's traffic source and session. A signed-in shopper's saves, removes and shares also carry their Shopify customer ID as the GA4 `user_id`.

## Consent

> [!NOTE]
>
> Events are only sent for shoppers who have allowed analytics in your store's cookie banner, and only when Google Analytics is already running on your store. Loveful reads the visit from Google Analytics' own cookies, so without them there is nothing to link the event to.

This covers guests as well as signed-in shoppers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.