How it Works: Recharge to Google Analytics connection
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 GA account, and how the integration works behind the scenes.
For information on sending Recharge data to your Segment workspace, see the Shopify to Segment guide (under "Subscription events").
Tracking subscription orders
In addition to the one-off orders tracked automatically by Littledata's Shopify connection, our Recharge connection 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:
- First time subscription orders are tagged as
Subscription First Order
* - Recurring orders generated by the terms of the subscription contract are tagged as
Subscription Recurring Order
- 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.
Recharge checkout events
These events work for Shopify's unified checkout. Read more about unified checkout steps.
When the end customer starts and progresses through the checkout we send events to Google Analytics:
Step | GA4 event name |
---|---|
1 | begin_checkout |
2 | add_shipping_info |
3 | add_payment_info |
These checkout step events contain all the product data, and can be segmented by product, SKU, brand etc - along with any other user dimension in Google Analytics.
The trigger for these events are checkout/created and checkout/updated webhooks from Recharge (fully server-side).
See how to configure the checkout funnel in GA and how to use those events for PPC retargeting.
Littledata’s checkout tracking works without the need to add Google Tag Manager or other tracking scripts to the Recharge checkout. This simplifies implementation and reduces the risk that 3rd party scripts will interrupt or intercept sensitive payment details or other data.
Here is an example of a checkout event payload sent to Google Analytics 4:
{
"name": "begin_checkout",
"sent_from": "Littledata server",
"currency": "USD",
"value": 169.95,
"littledata_client_id": "362565843.1666037349",
"params":{
"items":[
{
"item_id": "6572436193342",
"item_name": "White Tee",
"item_brand": "Littledata",
"item_variant": "white / xl",
"item_variant_id": "39391140118590",
"item_sku": "TEE_123",
"item_category": "Tees",
"price": 169.95,
"currency": "USD",
"quantity": 1
}
],
}
}
Subscription lifecycle events
Littledata sends complete subscription lifecycle events to Google Analytics (or Segment). This helps you understand subscriber growth and customer behavior in more detail.
The connection automatically adds tracking for the following events:
- Subscription Created
- Subscription Cancelled
- Subscription Updated
- Order Processed
- Charge Failed
- Payment Method Updated
- Max Retries Reached
Read the full guide to tracking subscription lifecycle events in Google Analytics with Littledata. The guide includes details about event naming conventions in Segment and Google Analytics.
How to implement tracking for a Headless storefront using Recharge
All the steps needed in tracking and linking the customer journey on a Headless storefront are highlighted in our Headless Demo.
Depending on the destination of the data, there is a selection of identifiers that need to be passed onto the checkout order_attributes via the Recharge checkout API.
Where to find subscriptions in Google Analytics
With the Recharge connection, you can distinguish between three types of order:
- One-time orders (affiliate code:
Shopify
) standard one-off orders through your Shopify checkout - First-time subscriptions (affiliate code:
Subscription, Subscription First Order
): first-time subscription orders made via Recharge - Recurring orders (affiliate code:
Subscription, Subscription Recurring Order
): recurring subscription orders made via Recharge - 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 in Google Analytics.
How the Recharge connection works behind the scenes
Littledata makes a server-side integration between Shopify and Google Analytics. Every time an order is processed on Shopify, Littledata links that revenue to the user in Google Analytics (as stored in the _ga
cookie). To link orders to users, Littledata needs to add the customer’s client ID to the note attributes of the order; that will appear in your Shopify admin, but is not visible to customers.
If our app cannot find a user session associated with the order — for example, when the subscriber signed up before you installed Littledata’s tracking — we add a default client ID. You can still link all these ‘orphan’ user sessions together via the Shopify customer ID
dimension.
Learn more
- Recharge connection overview and Recharge FAQ
- Custom dimensions for tracking customer lifetime value (LTV)
- Plus plans for Recharge stores on Shopify Plus