Google Analytics (GA4)

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.

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

In this article, we will cover


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.

Types of 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 analysing 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.

  1. 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.

  1. 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.

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

  1. 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.

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

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

  1. 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.


Facing issues?


No need to fret. We’re here to jump in and help you out. Reach out to us at support@loopwork.co or feel free to ping us on chat by clicking the support beacon on the bottom right
Thanks
Loop Subscription Team
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.