How to Connect Multiple Visits Using Google Analytics’ ClientID & Custom Dimensions

How to Connect Multiple Visits Using Google Analytics’ ClientID & Custom Dimensions

Multiple VisitsWhen someone’s searching for information about a product or service you offer, they may click on multiple sites, including your site, other sites, review sites, and then come back later and convert on your site.

As described in this article, Google Analytics’ multichannel funnels are great for visualizing attribution of conversion over multiple visits.

But what happens if you want to get more granular and actually link specific (but anonymous) visits together for unique visitors?1

If you’re using Universal Analytics (and you’re not, you really should be planning to upgrade), consider storing the randomly-generated visitor identifier (known as Client ID) automatically created by Universal Analytics in a Custom Dimension.  This will enable you to do all sorts of offline analysis for insights about multiple visits that lead to conversion2.

Since most of our readers are analysts and not developers, the following may not be enough to do it all yourself, but it’s enough for you to point your developer in the right direction and work with him/her to implement.  Some of the specifics will depend on whether you’re using Google Tag Manager (GTM).

If your developer needs some assistance, here’s how you can get them started.

All visitors on a site using Universal Analytics are automatically assigned a randomly generated ClientID by Google Analytics.  Regardless of whether or not you are using GTM, you can take advantage of this if you have your developers implement the following:

  1. Set up a new Custom Dimension to hold the value of the ClientID.  Perhaps call it GA CID (Google Analytics ClientID).  Make sure you set the scope to User. 
  2. Have your developer get the ClientID out of the _ga cookie3 and store it in the Custom Dimension you’ve set up.
  3. Create a Custom Report with your newly created GA CID Custom Dimension, alongside metrics such as sessions and specific goal completions important to you.
  4. The Custom Report should now show you a list of GA CIDs and the number of sessions and goal completions for each GA CID.

Need to get even more granular?  What questions do you want to answer?

Using the reporting API, or a tool such as either Next Analytics or Analytics Canvas, go ahead and extract information about your visitors that will help you answer these questions.  Perhaps as a combination of dimensions such as:

  • Custom Dimension GA CID
  • Source/Medium
  • Hour of Day (gives you both hour and day)
  • Device Category (mobile, tablet, computer)
  • CIty or Region or Country
  • Campaign (if relevant)

alongside metrics such as:

  • Sessions
  • Individual goal completions
  • Average Duration

With an extract such as this, you can answer questions about days to conversion, number of visits to conversion, days between visits (recency), or you can segment by city, region, campaign, etc for visitors, as identified by anonymous GA CIDs.

It’s important first have questions you’re trying to answer before you jump into any data extraction exercise.  Otherwise, you’ll have a solution looking for a problem, which isn’t very useful at all.

Let us know if this triggers some “I wonder if…” questions for you, of if there are questions that come to mind and you’re not sure what dimensions and metrics to extract.


1 If you’re going to use this method, it’s very important that the information extracted is not used to profile specific individual users.  Use the information to better understand how individuals behave, but not how specific individuals behave. Be responsible and respect privacy.

2 Multiple visits on the same device.  Without authentication (future post) to link the devices together, each device will have a different ClientID

3 Curious about the 4 values in the _ga cookie?  Check out this Stack Overflow post. The ClientID is the 3rd value in the cookie.


By |2020-03-23T16:53:30-04:00August 29th, 2014|7 Comments
Categories: Google Analytics


  1. Chris Erickson 2015-01-14 at 02:00 - Reply

    The post states that ” Some of the specifics will depend on whether you’re using Google Tag Manager” but then doesn’t mention GTM again for the rest of the post…?

    • June Li 2015-01-14 at 08:06 - Reply

      Hi Chris,
      Thanks for pointing out there’s a bit of a gap in the explanation. The 4 steps listed are generic and not dependent on whether or not Google Tag Manager is used.

      The specific methods used to extract data and populate the custom dimension are dependent on the way the website is constructed and whether Google Tag Manager is used. These details therefore have to worked out site by site. I’ve added this clarification to the post above.

  2. Ali 2015-03-18 at 18:42 - Reply

    What happens when a user returns to your site, the CID will be overwritten correct? For example, If I wanted to use this to track customer lifetime value over the course of 6 months, I couldn’t, because I couldn’t have one persistent CID over the course of the 6 months, unless the visitor maintains one single session, correct?

  3. Brian 2016-02-23 at 15:26 - Reply

    Hi June,

    Thank you for all the helpful articles. I’ve learned quite a bit by just browsing your blog over the past few months. I do have a question regarding the CID vs. UserID.

    I work in the higher edu industry and our CRM is used to to capture and store leads from prospective students. For example, when a prospect submits a ‘request info’ form, a new record in created in our CRM upon submission. I’m trying to figure out how to pass an identifier both to GA and to our CRM to better analyze leads. Currently, our admissions team has no insight into which channel is driving leads. The only data we have is from GA that will provide the # of leads by channel. Our end-goal would be to pass a unique identifier to our CRM upon a form submit and then import the data to GA from the CRM to match individual leads down to the channel source.

    Would the de facto way of doing this be to send the CID to the CRM through a hidden form field on submission? When the form is submitted, a unique UserID is created for each record too – I’m wondering if we could leverage this in anyway. Any feedback would be greatly appreciated.

    Thank you,

    • June Li 2016-02-23 at 15:46 - Reply

      Hi Brian,
      You can definitely pass CID to your CRM, and you may also be able to send back an anonymous UserID back to GA. There is other data that you can also pass to your CRM that might be useful, such as count of sessions (i.e. if they returning, how many times have they visited?) and the source/medium/campaign of the visit.

      May I contact you offline via your email ID to set up a call? It would be easier to discuss by phone/web conference.

      Thank you for your kind feedback. I’m glad you’ve found our blog to be useful.


  4. Brian 2016-02-23 at 17:26 - Reply

    Thanks, June. Sure, that would be great!

Leave A Comment