How to Send Custom Dimensions via GA4 Server-Side

Learn how to send custom data, like Payment Method or Billing Location, to GA4 via your Server-Side integration

👍

Note: Available for Elevar's Fully Managed Server Customers Only.

Overview

Available Custom Parameters:

The following data is available to be sent as custom dimension/metric:

  • Order Name - Ex: #1234. If you need to send Order Name (4003238923893) to GA4 in order to send refund data to GA4, you'll also be able to utilize the easier to read Order Name as well.
  • Shipping Method - The title of the shipping method associated with the order. Ex. Standard, Economy, etc.
  • Sales Channel - The source_name of the channel that created the order. Ex: Orders created via the online shopify checkout have a source_name of web. Orders created via Point of Sale have a source_name of pos. [What sales channels do I have?]
  • Payment Method - Ex. shopify_payments, paypal, etc
  • Billing Country - Ex: US
  • Billing Province - Ex: District of Columbia
  • Billing Zipcode - Ex: 20001
  • Billing City - Ex: Washington
  • Shipping Country - Ex: US
  • Shipping Province - Ex: District of Columbia
  • Shipping Zipcode - Ex: 20001
  • Shipping City - Ex: Washington
  • Customer Tags - Ex: VIP, Subscriber
  • Order Tags - Ex: Subscription First Order, Warranty Order
  • Customer Type - Ex: new or returning
  • Purchase Type - Ex: one_time, first_subscription, recurring_subscription
  • Total Discount Amount - Total_discount_amount is sent as an event parameter. It can be configured in GA4 admin as either a custom dimension or a custom metric. Ex: 5

📘

Note: We send event-scoped or user-scoped custom parameters. You can configure event-scoped custom parameters to be either custom dimensions or custom metrics. User-scoped parameters are limited to being set as custom dimensions.

Prerequisites:


Create a Custom Dimension or Metric in GA4

Sign into Google Analytics:

Google Analytics

Navigate to Admin Settings:

  • Begin on your Google Analytics 4 homepage.
  • Click on the "Admin" or gear icon in the lower left-hand corner of the homepage.
    • (See Figure 1)

Step 1 screenshot

Figure 1

Locate Custom Definitions:

  • Once in the Admin settings of your Google Analytics 4, use the left hand menu to select the drop-down tab titled, "Data display".
  • Within the drop down tab titled, "Data display" locate and click on the "Custom Definitions" tab.
    • (See Figure 2)

Step 2 screenshot

Figure 2

Create Custom Dimension or Metric:

  • After you have navigated to the custom definitions of your Google Analytics 4, you will be brought to a page that highlights all of your custom definitions.
  • To create a new custom dimension, click on the box in the upper right-hand corner of the page titled, "Create custom dimension". To create a new custom metric, navigate to the "Custom metrics" tab.
    • (See Figure 3)

Step 3 screenshot

Figure 3

Enter Custom Dimension or Metric Data:

In our example, we'll walk through the custom dimension example.

  • In order to create your custom dimension, you will need to input specific data into the "New custom dimension" pop-up window.
    • In the box labeled, "Dimension Name" title your new custom dimension something that is identifiable. This is the title that you will see in your reports.
    • Use the drop-down menu to select the type of Scope for your custom dimension. Choose "Event" if you want the data to be associated with specific events (E.g. Total Discount Amount, Sales Channel, Payment Method). Choose "User" if you want that data to be associated with specific users (E.g. Billing Country). Choose "Item" if you want the data to be associated with specific items.
    • In the box labeled, "Description" you have the option to include text that describes the data.
    • In the box labeled, "Event Parameter" add a unique text that you will use later in Elevar. The Event parameter must use lowercase letters and "_" instead of spaces (e.g. sales_channel, total_discount_amount, payment_method, billing_zipcode).
  • Click on the "Save" button in the upper right-hand corner of the pop-up window to save your new custom dimension.
    • (See Figure 4)

Step 4 screenshot

_Figure 4_

🚧

Note

You will see a value of [not set]for a GA4 custom dimension in the first 48 hours. [Documentation]

Setup Custom Dimension in Elevar

❗️

Note: If you are using this set up for total_discount_amount, then you can stop here!

We always send "ep.total_discount_amount" with every sever purchase even to GA4. So there is nothing to update in Elevar.

Navigate to GA4 in Elevar:

  • Begin on your Elevar homepage and use the left-hand menu to click on the "My Tracking" tab.
  • Once on the "My Tracking" page, navigate to your destinations and click on GA4
    • (See Figure 5)

Step 1 screenshot

_Figure 5_

GA4 Settings:

  • After navigating to your GA4 destination, use the "Setup Steps" box and click on the step titled, "GA4 Settings".
  • Within the "GA4 Settings" box, click on the drop-down menu titled, "Advanced Options".
    • Locate and click on the additional button labeled, "Specify Custom Dimensions" at the bottom of the GA4 Settings box.
      • (See Figure 6)

Step 2 screenshot

Figure 6

Specifying Custom Dimensions:

  • Before starting to specify the custom dimensions, ensure that you have completed the previous steps in Google Analytics 4 and have the details of the custom dimension you created.
    • Use drop-down box labeled, "Data to Send" and select the name of the dimension that you previously created.
    • In the box labeled, "Parameter Name", input the exact Event Parameter that you created for your custom dimension.
    • Use the drop-down box labeled, "Scope" and select the same scope of the custom dimension that you created.
    • After all of the specific custom dimension information has been entered, click on the "Save" button at the bottom of the page.
      • (See Figure 7)

Step 3 screenshot

Figure 7

Confirm Changes:

  • After you click on the "Save" button at the bottom of the GA4 settings page, you will be prompted to confirm the changes. Click on the "Yes, Save Changes" button.
  • Once changes are saved, they will be live! Give Google Analytics 4 about 24-48 hours to start seeing data available in reports.
    • (See Figure 8)

Step 4 screenshot

Figure 8