Skip to main content

Google analytics (GA4)

Learn how to integrate Google Analytics 4 with Loop to track recurring subscription transactions and gain unified revenue insights in GA4.

Updated over a week ago

Loop’s Google Analytics 4 integration allows you to track the recurring order transactions of subscriptions along with your non-subscription transactions and thus providing a complete picture of your store revenues in your main GA4 account.

Key features

  • Server-side integration avoiding the need to add Google tag manager or any tracking scripts separately for the Loop app.

  • For every event sent on GA4, we add the Shopify customer id as the user id which helps in linking different subscription order events to a common customer.

  • We only send transaction data for recurring orders and not the origin order generated from Shopify checkout preventing duplication of the same order.

If you are just getting started, then we recommend reading this Google help doc to help you understand how GA4 works and how to get migrated from Universal Analytics to GA4.

GA4 integration is available on both the Loop Starter and Pro plans


Types of events

  • Recurring order successful transactions

  • Payment failed events

  • Subscription life-cycle events

Recurring order successful transactions

Whenever a recurring order billing is attempted, we send out GA4 events having the products, price, quantity, tax, shipping information related to the order.

  • loop_order_processed

  • loop_order_partially_processed

Payment failed events

Whenever a recurring charge attempted from Loop fails, we send out GA4 events having the subscription_id, value, failure_reason information related to the order.

  • loop_payment_attempt_failed_with_retries_left

  • loop_payment_attempt_failed_last_retry_left

  • loop_payment_attempt_failed

Subscription life-cycle events

Along with the transaction events, we also send important subscription events which can help you in analyzing your store subscriptions performance.

  • loop_subscription_created

  • loop_subscription_paused

  • loop_subscription_resumed

  • loop_subscription_cancelled

  • loop_subscription_reactivated

  • loop_subscription_expired

  • loop_order_skipped

  • loop_order_out_of_stock

Connecting GA4 account to Loop

To connect your Google Analytics 4 account, you would need to obtain “api_secret” and “measurement_id”.

  • api_secret:

    • API secret key generated in GA4 account required to enable additional events to be sent into a specific data steam from an external server.

    • To create a new API secret, navigate to Admin > Data Streams > choose your stream > Measurement Protocol > Create

  • measurement_id:

    • Measurement ID associated with a specific data stream in GA4.

    • It can be found under Admin > Data Streams > choose your stream > Measurement ID

Steps to look up API secret and measurement ID

  1. Click on the admin icon (at the bottom) and select relevant account and GA4 property to connect over to Loop. Then click on the "Data Streams" option.

  2. Choose one of the data streams in which you would want to receive the Loop events. If no stream added yet, click "Add stream" to add one and choose the "Web" option.

  3. When you click on a data stream, you would be able to see Stream details bar on top of the drawer. The left most option will be showing the Measurement ID of the stream as highlighted in the screenshot below. Copy and paste this value in the Measurement ID field of Loop Set up instructions page.

  4. Click on the "Measurement Protocol API" secrets option as highlighted in the screenshot below.

  5. If you have not generated any API secrets yet, it is highly likely that Google would want you to acknowledge the terms before creating an API secret. In that case, click on the "Review terms" button and acknowledge the terms.

  6. Once you acknowledged the terms, you would be able to see "Create" button. Click it to create a new API Secret.

  7. Choose a name for the API secret, preferably "Loop subscriptions" for future reference.

  8. Once, you click on "Create" button, you would be able to see the newly generated API secret. Copy and paste this value in the API Secret field of Loop Set up instructions page.

Need help?

No worries - we're here for you!

If you have any questions or need assistance, feel free to email us at [email protected] or chat with us using the support beacon at the bottom right of your screen.

Regards,

Loop Subscriptions Team 🙂

Did this answer your question?