Stape

Track user source/medium flow using server Google Tag Manager

Updated
Feb 5, 2022
Published
Nov 30, 2021
Also available in

Google Analytics offers a variety of reports allowing you to examine user behavior. The most frequently used report when analyzing conversions is exploring source/medium. When configured correctly, this type of report gives valuable insights on which traffic sources bring in more users and conversions.

Google Analytics has a lot of different models for how to attribute conversions. Still, the default model is last click non-direct traffic, which means conversion will be attributed to the most recent non-direct traffic source. Though this type of attribution model can be relevant for some websites, it may not be accurate for others (especially websites with high average order value) since users have multiple interactions before purchasing on the site. And the last traffic source may not have the most significant role in a user’s decision to buy your product. 

Stape created the Channel Flow tag for the server Google Tag Manager that helps track all user interactions with the site. In this post, I want to talk about using Server GTM to track the user’s first, last source/medium, and all interactions in between.

How does the Channel Flow tag for the server GTM works?Copy link to this section

The logic of our Channel Flow tag is straightforward. It records users’ first, last, and all middle interactions in the browsers’ cookies. 

  • Channel_flow - records the source/medium flow of all user interactions with the site
  • Channel_flow_first - records the first source/medium
  • Channel_flow_last - records the last source/medium
ads user channel flow in cookies

Channel flow tag configurations:Copy link to this section

URL Source - defines a variable that contains a URL. You can select page_location to use URL from Common Event Data or provide a variable that returns a valid URL string.

Referrer Source - defines a variable that contains Referrer. You can select page_referrer to use Referrer from Common Event Data or provide a variable that returns a valid Referrer URL string.

Search Engines Regular Expression - you can modify this reg exp to include or exclude organic traffic sources.

Cookie lifetime - Channel Flow cookies expiration in seconds (set 0 for session cookie). 2 years by default.

How can you use the Channel Flow tag?Copy link to this section

There might be multiple use cases for the channel flow tag, but initially, we created this tag to help measure affiliate conversions and assign affiliate commission appropriately. But then we realised that the channel flow tag could be used in several other ways, like Google Analytics and CRM. I'm sure there are tons of different use cases!

Affiliate conversion winCopy link to this section

Let’s say you work with several affiliate partners or have offers in multiple affiliate networks. Who should receive a commission if two affiliates participated in one conversion flow? Should you split the commission between the two of them? How to determine whose interaction was the first one and whose the last? 

No matter what rules for assigning affiliate commission you have, a channel flow tag can help. You can use the channel flow tag to determine what affiliate wins the conversion based on their positions in the channel flow.

Affiliate commission rateCopy link to this section

Another scenario when the channel flow tag helps is assigning commissions based on the affiliate's position in the conversion interaction path. For example, when two affiliates participate in the conversion path, you might want to assign 80% of the commission to the last interaction, while the rest of the commission should go to another affiliate. 

Track initial traffic source in Google AnalyticsCopy link to this section

The default Googles Analytics attribution assigns conversion to the last click non-direct traffic source. This information might not be enough when evaluating the effect of each channel. Using stape’s channel flow tag, you can compare the first and last interaction traffic sources.  

Analyzing the first attribution traffic source is essential because it helps understand how customers heard about your site and what impact each traffic source has on brand awareness. 

Add first/last interaction source and channel flow to the CRMCopy link to this section

Some popular CRMs like WooCommerce have plugins that help to add first/last click interactions to every order. With stape’s channel flow tag, you can add first, last, and middle attribution source/medium to the CRM. It can be a critical feature for a higher value product where you want to know each step of users’ interaction with the site before they purchase. 

How to set up the Channel Flow tag?Copy link to this section

    2. Send data to the server GTM container. We have blog posts that describe how to send data to ss GTM using Google Analytic 4 and Data Tag/Data Client.

    3. Download Channel flow tag from GitHub -> Open templates sections in the server Google Tag Manager container -> Click New. Or add using Community Template Gallery.

    4. Click three dots in the top right corner -> Click Import -> Select channel flow tag template you’ve recently downloaded from GitHub -> Click save. 

    5. Create a new tag in the server Google Tag Manager container. Tag type should be the Channel flow tag. Make required configuration. You can modify URLs, referrals, add organic sources and set a cookie lifetime. 

    6. Add a trigger to this tag. I will trigger the Channel Flow tag on every request claimed by Google Analytics 4 client.

set up channel flow tag server google tag manager container

Conclusion:Copy link to this section

Channel Flow tag is an easy way to see what traffic sources drove user interactions and influenced their decisions. If you work with affiliate partners, it could help assign different commissions based on where in the journey someone has reached during your marketing campaigns or partnerships.

Channel flow tag provides insight into how users interact with your site, how they get familiar with the brand, research it, and finally, what makes them buy your product. 

This info can help to better market your products by identifying user's interaction with the site at different points along the acquisition process.

You'd like to track user source/medium flow?

All it takes is a few simple questions. Click Get A Quote, fill up the form, and we will help you.

Get a Quote

Relevant posts

Updated Oct 24, 2022

How to export Google Universal Analytics raw data to BigQuery

For Google Universal Analytics, Google still has not provided free options to export raw data to BigQuery or any other database for that matter. But what if you don’t have plans to migrate to GA4 and want to get the benefits of BigQuery raw data? I decided to solve this question with GTM Server Side tagging and created this how-to article for you.

Updated Oct 24, 2022

How to Filter Google Analytics Spam With the Help of Google Tag Manager Server-Side Tagging

What if you are faced with spam in Google Analytics reports? Does it mean that someone can access your Google Analytics accounts? Or maybe someone can modify data inside your GA? How can you prevent it? There are two main types of Measurement Protocol spam: referral traffic and events spam. More rarely you can see spam in languages, keywords, URLs, transactions, and so on. In this article, I will explain what Measurement Protocol spam is and how you can prevent it with the help of Google Tag Manager Server-Side tagging.

Updated Mar 3, 2022

How to set up Google Analytics with Google Tag Manager Server-Side Container?

Google Tag Manager server container has close integration with Universal Analytics. When you set up GTM server tagging, you will see that Universal Analytics Client is created by default. In this article, we will discuss the benefits and possibilities that server-side Google Analytics offers. And also, how to configure Google Analytics in your Google Tag Manager Server account.If you don’t have a GTM server container yet, please follow this instruction on how to launch it on your website. If you are still not sure what GTM server tagging is and how it can benefit your website tracking system, please read this blog post.

Host your GTM server at Stape