Logo

Why We Use Order ID as Transaction ID in Google Analytics 4

Why SlideRule uses Shopify Order IDs (5214812864687) as Google Analytics 4 Transaction IDs instead of Shopify Order Numbers (#21616).

Overview

SlideRule uses Shopify Order IDs (5214812864687) as Google Analytics 4 Transaction IDs instead of Shopify Order Numbers (#21616).

The main reasons why are:

  1. It's easier to find orders with the order ID.
  2. You can still search for orders with the order id.
  3. The order ID is the unique identifier in Shopify's database.

Locating Orders with Order ID

The Shopify Order ID can be found in the URL of an order page in your Shopify store.

Shopify Order ID in URL

To locate a specific order using the order ID, simply copy the transaction ID from GA4, and replace the order ID in any order page URL with the copied transaction ID. This will take you directly to the desired order.

Additionally, the search feature in Shopify works with both the order ID and the order number. Searching for an order ID will still bring up the associated order.

Searching for an order in Shopify using Order ID

Handling Duplicate Order Numbers

In rare cases, duplicate order numbers can occur in Shopify when importing orders from other sources. However, duplicate order IDs are not possible, as the order ID serves as the unique identifier in Shopify's database.

Using the order ID, you can export data from GA4 to a Google Sheet and create a simple function to generate links to the orders like so:

=CONCATENATE("https://admin.shopify.com/store/slideruleanalytics-demo/orders/",A9)

This is not possible with order numbers.

Adding Order Name as a Custom Dimension While we send order IDs as the transaction IDs to GA4, we also send the Shopify order name as a custom parameter on purchases. You can add it to your GA4 reporting custom parameters like so:

  1. Go to your GA4 property
  2. Click the Admin gear in the bottom left
  3. Select Custom definitions
  4. Create customer dimensions
  5. Enter the below information
Dimension Name = "Order Name"
Scope = "Event"
Description = "The name of the order from Shopify."
Event parameter = "order_name"
Adding Order Name as a Custom Dimension in GA4