# How it Works: Recharge to Google Analytics connection

![shopify to google analytics](/files/yALWPDB639pkiPUzh8Yn)

This is a guide to how Littledata's Recharge connection works with your Google Analytics setup. We look at which subscription events you can track, how to use Littledata's views and filters in your Google Analytics account, and how the integration works behind the scenes.

{% hint style="success" %}
For information on sending Recharge data to your Segment workspace, see the[ Shopify to Segment guide](/integrations/shopify-to-segment/how-it-works.md) (under "Subscription events").
{% endhint %}

## Tracking subscription orders

In addition to the one-off orders tracked automatically by Littledata's [Shopify connection](broken://pages/BJnSNIXZTnuy6ncEONuJ), our [Recharge connection](broken://pages/3fZy6hSEquK6cb0b5X9R) tracks different types of subscription orders, including first-time subscription orders, recurring orders, and prepaid subscriptions. This helps with both marketing analysis (seeing where subscribers come from) and LTV analysis (seeing where your *best* subscribers come from, and how their subscriptions evolve over time).

We automatically sets the **order affiliation** in Google Analytics for all orders coming from Recharge as follows:

1. **First time subscription** orders are tagged as `Subscription First Order` \*
2. **Recurring orders** generated by the terms of the subscription contract are tagged as `Subscription Recurring Order`
3. **Prepaid recurring orders** generated by the terms of the subscription contract are tagged as `Subscription Prepaid Order`

\* For subscriptions in the Shopify checkout, this affiliation is only added once you have authorized Littledata's app to access Recharge.

In Google Analytics you'll need to create an event-scope custom dimension for the `affiliation` property to use this in segments or reports.

![adding affiliation dimension](/files/JurqLUQE6nhVKXrrpew9)

## Subscription lifecycle events

Littledata sends subscription lifecycle events to Google Analytics and [Segment destination](/integrations/shopify-to-segment/how-it-works.md).

We automatically tie these events back to the original customer web session. This means that you can retarget customers in Google Ads whose payments have reached the maximum number of retries, or see how many cancelations came after users clicked on an Instagram Ad.

![find recharge events in GA](/files/N2zOTLiLNCsHBRkgkIem)

The following events are tracked by default:

| Event                      | Google Analytics event       |
| -------------------------- | ---------------------------- |
| Subscription Created       | subscription\_created        |
| Subscription Cancelled     | subscription\_cancelled      |
| Subscription Updated       | subscription\_updated        |
| Subscription Skipped       | subscription\_skipped        |
| Subscription Charge Failed | subscription\_charge\_failed |

## Where to find subscriptions in Google Analytics

With the Recharge connection, you can distinguish between three types of order:

1. **One-time orders** (affiliate code: `Shopify`) standard one-off orders through your Shopify checkout
2. **First-time subscriptions** (affiliate code: `Subscription, Subscription First Order`): first-time subscription orders made via Recharge
3. **Recurring orders** (affiliate code: `Subscription, Subscription Recurring Order`): recurring subscription orders made via Recharge
4. **Prepaid orders** (affiliate code: `Prepaid, Subscription, Subscription Recurring Order`) recurring subscription orders made via Recharge that are paid in advance for a fixed period of time, usually 6 or 12 months.

Learn more about how to [segment orders using the 'Affiliation' dimension](/sources/recharge/how-to-check-if-the-littledata-recharge-integration-is-working.md) in Google Analytics.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.littledata.io/sources/recharge/how-it-works-recharge-to-google-analytics-connection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
