Google Analytics

Advanced Session Stitching and Cross Device Attribution using Custom Dimensions in Google Analytics

In today’s world, a visitor may touch your digital presence from a variety of devices and locations – and multiple times before they buy your product or contact you. They may visit your site from their desktop at home, then go to work and visit your site from their mobile app. Finally, their conversion may happen days later when they come home from work and then log into your system.

Conversion doesn’t start with conversion. There’s a whole process that preludes it – including research, awareness, and interest. Different segments of your traffic may have different behaviors and a different path to conversion. To truly optimize your site and understand your data, you need a full view of how users move through the decision-making funnel toward conversion and really be able to dissect and understand them. In this post, we’d like to show you how!

What is Session Stitching?

“Stitching” in this context is basically grouping visits/sessions (that otherwise wouldn’t be connected) using a unifying key(s). There are a couple “keys” we can use in Google Analytics to do this.

For example, already native to Google Analytics is the the User-ID feature, which let’s you group or “stitch” together sessions based on id’s provided by your backend system when users log into your website or app.

But do you, as an internet surfer, log into amazon.com, every single time you research a product? Most likely not, only when you’re ready to buy (or if you want to see if something is Prime eligible 🙂 ). So for marketers to really be able to connect the dots of the entire path of their visitors, we need to somehow include the visits where the user may not have logged in.

In this post, we’d like to talk about some advanced stitching techniques within GA using a combination of a couple different keys – User-ID (native to GA) and Custom Dimensions (clientID’s and userID’s stored in custom dimensions).

Note: When implementing these methods, there’s potential to store user identifiable information that violates your privacy policy (as well as the general privacy of your visitors). Check with your legal team and company privacy policy and ensure compliance.

Basic Session Stitching in GA – Native User-ID and Session Unification

As mentioned, out-of-box, Google Analytics allows you to group a users sessions based on login using the “User-ID” feature. Even further, it allows you to go backwards and associate otherwise disconnected portions of these sessions (since the user may not have been logged in during the whole visit) using session unification.

Without session unification, session 2 is separated:

With session unification, session 2 is connected:

(images from Session Unification Help Article)

What about those sessions where these visitors never logged in? We’re still missing that data. The clue/key that can provide more insight there is the clientID.

Intermediate Session Stitching – Associating Anonymous and Logged-in Users (clientID’s and userID’s)

GA identifies each device + browser with a unique clientID. If there are sessions that contain a clientID (from a device) and a userID (the user on that device logged in), we’re going to assume that any session with that particular clientID, even where the visitor isn’t logged in and a userID is absent, is that same user. This is a powerful inference – because you now have a whole new batch of sessions that you can potentially associate with the user and group together – more pieces to your funnel.

Advanced Session Stitching – Users Across Multiple Devices

A user visits your site at home on his desktop then at work on his work smartphone. There are now two ClientID’s for the same user. They don’t log in on their first visit, but log in on their second visit. They get back home, and log in on their third.

You probably can see where we’re going with this. The second we can associate a clientID and a userID, we can make an assumption that they belong to the same person/user. So if you can associate 2 different clientID’s with the same userID, those clientID’s belong to the same person/user as well. Once again, we’ve opened insights to more visits that can be grouped as the same user. Now, anywhere you see either clientID or the userID, you can group them as one user and potentially the same funnel!

How to Implement Advanced Session Stitching

While we discussed there already is a native User-Id feature within GA, in order to really enable advanced session stitching and get the full robust advantage of Google Analytics features and reporting, you will need to store the clientID as well as the userID in a Custom Dimension.

  • Create the 2 Custom Dimensions in GA.
    • userID (or UUID or AccountID or MemberID, etc) – User Scope
    • clientID – Session Scope
  • Since the clientID is the ID that GA uses internally, we’ll need to read that from the Universal Analytics cookie or ask analytics.js for the value using the .get method. Once that’s done, we can store that in a custom dimension.
  • The userID is any ID that you assign to a user when they authenticate (as long as it isn’t PII). This will be determined by your organization, and once that’s done, store that into a custom dimension.

Now you have the flexibility of segmenting and filtering based on these two parameters since they are custom dimensions! Using custom dimension session stitching to connect single users to multiple sessions and multiple devices to single users provides a customer centric approach. We can hone in on the actions of individual customers to identify patterns of movement through content and devices/browsers. Knowing this information can help us refine the sales funnel and identify new types of users for advanced segmentation through further analysis outside of GA.

Caveats

Stitching sessions through userID and clientID custom dimensions certainly provides more meaningful information than GA’s native User-ID and session unification, but it isn’t perfect.

Some of you advanced analytics ninjas already may have thought, “We’re assuming that once a user logs into a device, anytime you see that device it’s that user? What if someone else is using that same device? Or what if you actually do find multiple users using the same device/browser? What if the same user has multiple login credentials?”

Also, any device that the user never authenticates on can’t be stitched, so you could be missing some pieces.

While this is all true, this is the nature of identifying trends. Sure, you can take it with a grain of salt, but stitching provides vast trends giving us direction/clarity and unique perspectives on the same data. This could lead to optimization that may not have been thought of before.

Analyzing and Stitching Outside of GA

Another consideration of the stitching sessions through custom dimensions is that the real useful analysis needs to be performed outside of GA. While the custom reports in this blog post show examples of clientID and userID custom dimensions within the GA interface, they simply identify the sessions to be analyzed. To understand the behavior in the sessions that lead to conversion, much more data will need to be exported from GA and analyzed in analysis and BI tools.

What cases have you run into that you’d like to see stitched? Comment below!

Feras Alhlou

Chief Technology Officer Feras Alhlou previously co-founded E-Nor in 2003 and served as President until its acquisition by Cardinal Path in 2019. Feras is passionate about his work with some of the world’s most recognized brands and public sector organizations to deliver data-driven marketing value. A recognized thought leader on the Google Marketing tech stack, he has traveled the globe educating businesses, practitioners, and consultants, and he’s also co-author of Google Analytics Breakthrough: From Zero to Business Impact. Feras received a Masters of Engineering Management degree from the University of South Florida and a Bachelor of Science degree in Electrical Engineering from the University of Tulsa. He is a Certified Web Analyst, Board Member for Red Cross Northern California, and a 3rd-degree black belt in Aikido.

Share
Published by
Feras Alhlou

Recent Posts

Optimizing user experiences with Digital Experience Analytics (DXA) platforms

As consumers become increasingly digitally savvy, and more and more brand touchpoints take place online,…

1 month ago

Enabling Value-Based Bidding with Google Tightlock

Marketers are on a constant journey to optimize the efficiency of paid search advertising. In…

1 month ago

Resolving “Unassigned” Traffic in GA4

Unassigned traffic in Google Analytics 4 (GA4) can be frustrating for data analysts to deal…

2 months ago

This website uses cookies.