> For the complete documentation index, see [llms.txt](https://help.littledata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.littledata.io/sources/recharge/how-it-works-recharge-to-google-analytics-connection.md).

# How it works: Recharge to GA4

How Littledata's Recharge connection labels subscription orders and sends subscription lifecycle events to GA4.

This page explains how Littledata's Recharge connection works with GA4. It covers how subscription orders are labeled, which subscription events are sent, and where to find them in GA4.

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-ab4ead720decff02f47aef7185ab6fe6d0aeece8%2Fconnection-google-analytics.png?alt=media" alt="Littledata combines browser, server, metafield and channel data and sends it to GA4"><figcaption></figcaption></figure>

{% hint style="info" %}
To send Recharge data to Segment instead, see [How it works: Shopify source for Segment](https://help.littledata.io/integrations/shopify-to-segment/how-it-works) (under "Subscription events").
{% endhint %}

### Tracking subscription orders

Littledata's [Shopify connection](https://help.littledata.io/integrations/shopify-to-google-analytics) tracks all orders. With the [Recharge connection](https://help.littledata.io/sources/recharge), Littledata can also tell recurring subscription orders apart from other orders. This helps you see where subscribers come from, and which channels bring your most valuable subscribers.

Littledata sets the `affiliation` parameter on each GA4 order event:

| Order type      | Affiliation in GA4                                              |
| --------------- | --------------------------------------------------------------- |
| Recurring order | `Subscription Recurring Order`                                  |
| Any other order | The order's Shopify tags, or `Shopify` if the order has no tags |

First subscription orders are not given a special affiliation. They use the order's tags, like any other order. If Recharge adds tags to your subscription orders, those tags show up in the affiliation.

#### How Littledata spots a recurring order

Littledata treats an order as recurring when, for example:

* Littledata's app is authorized to access Recharge, and Recharge reports the order as a recurring order.
* The order's tags contain the word "recurring".

Some other orders get extra labels added to their tags, for example draft orders and Shop app orders.

{% hint style="info" %}
To get the most accurate labels, authorize Littledata's app to access Recharge. Without it, Littledata relies on order tags only.
{% endhint %}

#### Add affiliation as a custom dimension in GA4

To use `affiliation` in GA4 reports and segments, create an event-scoped custom dimension for it.

{% stepper %}
{% step %}
**Open custom definitions**

In GA4, go to **Admin**, then under **Data display** click **Custom definitions**.
{% endstep %}

{% step %}
**Create the dimension**

Click **Create custom dimension**. Set **Dimension name** to `Affiliation`, **Scope** to **Event**, and **Event parameter** to `affiliation`.
{% endstep %}

{% step %}
**Save**

Click **Save**. New data shows up in reports within about 24 to 48 hours.
{% endstep %}
{% endstepper %}

### Subscription lifecycle events

Littledata sends subscription lifecycle events to GA4 and to the [Segment destination](https://help.littledata.io/integrations/shopify-to-segment/how-it-works). Littledata links these events back to the customer's original web session, so you can see which marketing channels lead to cancellations, skips or failed charges.

<div data-with-frame="true"><figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-40597f1faff359db0bdbc6536526f1644e3f142e%2Fscreenshot-2025-03-13-at-12.56.09.png?alt=media" alt="Recharge subscription events in the GA4 Events report"><figcaption></figcaption></figure></div>

These events are tracked by default:

| Event                      | GA4 event name               |
| -------------------------- | ---------------------------- |
| Subscription created       | `subscription_created`       |
| Subscription cancelled     | `subscription_cancelled`     |
| Subscription updated       | `subscription_updated`       |
| Subscription skipped       | `subscription_skipped`       |
| Subscription charge failed | `subscription_charge_failed` |

### Related articles

* [Getting started: Recharge connection](https://help.littledata.io/sources/recharge/recharge-integration-setup-guide)
* [How to check if the Recharge connection is working](https://help.littledata.io/sources/recharge/how-to-check-if-the-littledata-recharge-integration-is-working)
* [FAQ: Recharge connection](https://help.littledata.io/sources/recharge/recharge-faqs)
* [Tracking subscription orders in the Shopify checkout](https://help.littledata.io/sources/shopify/tracking-subscription-orders-in-the-shopify-checkout)
