How to Set Up Google Analytics 4 as a Server Side Destination
Follow this step by step guide to launching your Google Analytics 4 server-side tracking
Overview
Prerequisites
Before you can enable your Google Analytics 4 Server-Side Destination, you will need to:
- Install your Shopify source.
If you have not done this yet, follow our guide, How to Implement the Shopify Source on Your Shopify Store.
Add GA4 as a Server-Side Destination
Add Destination:
- On the homepage of your Elevar Account, locate the "My Tracking" button from the left-hand menu.
- Once, in "My Tracking" select the "Add Destination" button in the upper right hand corner of the page.
- (See Figure 1)
Figure 1
Locate GA4 Destination:
- A side bar pop-up window will appear, titled "Add Destination".
- Within this pop-up, use the search function and type "GA4".
- Once the GA4 destination appears from the search function, click on it.
Get Started:
- After locating and clicking on the GA4 destination, you will be taken to overview screen.
- Click the "Get Started" button in the lower left-hand corner of the Overview box.
- (See Figure 2)
Figure 2
Entering GA4 Settings
GA4 Measurement ID:
- Within the "GA4 Settings" section, type your GA4 Measurement ID in the box.
- If you have "Markets" enabled in your Shopify Source, you will see the "Markets" section in your GA4 destination.
- Select either the "All Markets", "Specific market(s)", or the "No Market ID" button to specify which markets will send data to GA4.
- If you have selected "All Markets" navigate to the section titled "Destination Label" and use the text box to enter a label. This is how your destination name will appear across the Elevar app (e.g., My Tracking, Reports, History) and helps to identify your destination across our app, especially when you have multiple instances of the same destination.
- If you have selected "Specific market(s)", navigate to the section titled "Market Groups" and use the drop down menu to select the market groups to specify which market's data will be sent to this destination. Then, navigate to the box titled "Destination Label" and use the text box to enter a label. This is how your destination name will appear across the Elevar app (e.g., My Tracking, Reports, History) and helps to identify your destination across our app, especially when you have multiple instances of the same destination.
- Once you have entered all of the required information for the GA4 settings click on the "Save and Continue" button at the bottom of this section.
- (See Figure 3)
Figure 3
Select Events:
- Once you have entered your measurement ID, you have to select what events you want to send to GA4.
- Click on the button labeled "Use best practices". Currently, our "Use best practices" recommends sending just the purchase event server-side.
- Most likely, you won't need to adjust anything within the Customized settings.
- After selecting what events you want to send to GA4, click on the "Save and Continue" button at the bottom of this section.
- (See Figure 4)
Figure 4
Pro Tip: Sending More Events Server-Side
Checkout Funnel: You can customize the events so that your checkout funnel events (begin checkout, add shipping info, add payment info) are sent server-side instead of client-side.
- We recommend sending these events client-side as we'll be releasing a future enhancement that, while it'll provide overall better checkout funnel data, it won't be able to ensure the ordering of events sent. And as we can't send a timestamp with the GA4 events, we won't be able to ensure the correct ordering of the checkout funnel events like we can with other destinations. However, if that is acceptable, you can choose to send your checkout events server-side as it'll have more accuracy (since this uses webhooks as the trigger instead of load-based events).
Refund: You can enable the Refund event, which is sent server-side. But you must use the Order ID as the transaction identifier. In addition, this event does not work if Consent Mode is enabled.
Sitewide events: We are looking into sitewide server-side events and hope to support this in the future.
Consent Mode:
- After selecting what events you want to send to GA4, you will be prompted to enable Consent Mode.
- Enabling Consent Mode: To enable Consent Mode, click on the "Yes, enable for this destination" button.
- By enabling Consent mode, your destination will be made "consent aware". This allows you to adjust when data gets sent to this destination based on the consent choices of your users.
- If you've configured consent mode in your data layer settings for cookie compliance, then you can configure this option here as well. [How to make sure my server-side tracking adheres to my consent rules]
- If you have enabled consent mode, by default your tracking will be set to utilize advanced consent mode and will send anonymous data to GA4. Learn more about GA4 data modeling with anonymous data.
- If you enable consent mode for GA4, navigate to the section of the page titled, "How would you like to send data to GA4" and click on either the "Send anonymized data" or the "Customized settings" button.
- Enabling Consent Mode: To enable Consent Mode, click on the "Yes, enable for this destination" button.
- If you do not want to enable Consent Mode in your data layer settings, click on the "No" button.
- Once you have all of selected all of the information for enabling Consent Mode, click on the "Save and Continue" button at the bottom of this section.
- (See Figure 5)
Figure 5
Select Transaction Identifier:
- After selecting details for Consent Mode, you need to choose a Transaction Identifier.
- Click on either the "Order Name", "Order Number", or the "Order ID" button. Currently, the Order Name is the most commonly used Transaction Identifier.
- After selecting the Transaction Identifier, click on the "Save and Continue" button at the bottom of this section.
- (See Figure 6)
Figure 6
Select Product Identifier:
-
After selecting details for the Transaction Identifier, you need to choose a Product Identifier.
- Click on either the "Product SKU", "Product ID", or the "Variant ID" button. Currently, the "Product SKU" is the most commonly used Product Identifier.
- However, if you wish to choose a different Product Identifier, you can override this for your purchase events. If you change this, just be sure you update all e-commerce events to use this new product identifier (e.g. add to cart, etc).
-
After selecting the Product Identifier, click on the "Save and Continue" button at the bottom of this section.
- (See Figure 7)
Figure 7
Filter Transactions:
-
After selecting details for the Product Identifier, you need to choose whether or not to filter transactions.
- This step allows you to control exactly what purchase events are sent to GA4.
-
Navigate to the section of the page titled "Filter Transactions" and click on either the "Yes, Block some transactions" or the "Yes, allow specific transactions" button.
- If you have chosen "Yes, Block some transactions" navigate to the section below titled "Block some transactions" and ensure that the "Use Best Practices" button is selected.
-
Once you have all of selected all of the information for Filtered Transactions, click on the "Save and Continue" button at the bottom of this section.
- (See Figure 8)
Figure 8
We'd recommend blocking any offline orders (e.g. Draft Orders) from being sent to GA4.
These orders don't have an associated session, so they may appear in your Traffic Acquisition Report as (not set). By default our best practice is to block exchange orders. You can leave this as is or add other offline channels
- Learn how to block additional types of orders in this guide.
- Not sure if you need to block and additional orders? Look at what Sales Channels you have in Shopify!
Subscriptions:
- After selecting the required information for filtering transactions, you will need to specify if you sell subscription products.
- If you sell subscriptions, select whether you are using the unified Shopify checkout, or using a separate checkout.
- If you do not sell subscriptions, select the button labeled "No".
- (See Figure 9)
Figure 9
Using unified Shopify checkout:
-
Click on the button labeled "Yes, using unified Shopify checkout".
-
Then, navigate to the section titled, "Would you like to send recurring transactions?" select the button labeled "No, block".
-
Once you have all of selected all of the information for Subscriptions using unified Shopify checkout, click on the "Save and Continue" button at the bottom of this section.
- (See Figure 10)
Figure 10
Using a separate checkout:
-
Click on the button labeled "Yes, using separate checkout".
-
Navigate to the section titled "What Shopify subscription app do you use?". Select the the button labeled, "ReCharge/ OrderGroove" if you use ReCharge or OrderGroove.
- If you use a subscription software that is not listed, select the button labeled "Other" and type in the software that you currently use.
-
Next, locate the section titled "Would you like to send first-time orders?". Select either the "Yes, send" button or the "No, block" button.
- First-time orders are the first purchases from the subscription sequence. You can choose to send recurring orders to this destination or to block them.
-
Then locate the section titled "Would you like to send recurring orders?". Select the button labeled "No, block".
- Selecting "No, block" is the recommended best use.
- Recurring orders are the scheduled repeating purchases that your shopper has subscribed to. You can choose to send recurring orders to this destination or to block them.
-
Finally, locate the final section under the subscription settings titled "Would you like to customize the attribution source/medium of the recurring orders?". Select the button labeled "Use source/medium override".
- Selecting "Use source/medium override" is the recommended best use.
-
Once you have all of selected all of the information for Subscriptions using a separate checkout, click on the "Save and Continue" button at the bottom of this section.
- (See Figure 11)
Figure 11
Web Container Setup:
- After selecting details for the subscriptions, you need to set up the Web Container.
- First, select the button labeled "Download Pre-Built Web Tags".
- Once downloaded, import the container into your Google Tag Manager web container.
- After importing the container into Google Tag Manager, publish the new tags.
- First, select the button labeled "Download Pre-Built Web Tags".
- After setting up the web container, click on the "Mark as Complete" button at the bottom of this section.
- (See Figure 12)
Figure 12
Going Live:
- After completing all of the previous GA4 Setup Steps, an Overview page will appear.
- If all of the details within the Configuration Summary look correct, then click on the button labeled "Go Live" at the bottom of this section.
- A pop-up window will appear, asking for a confirmation of your changes.
- Click on the button labeled "Yes, Go Live".
- (See Figure 13)
Figure 13
Remove your previous tracking
- If your previous GA4 tracking was implemented via Shopify follow this guide to remove your tracking. If you have installed a different way you'll want to remove that code or installation method.
Updated about 2 months ago