Analytics
3.6K members online now
3.6K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Capture Google Analytics "__utma" ID in a custom dimension

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

In GA, is it possible to capture the "__utma" ID of a session in a custom dimension?

 

please let me know 

 

Thank you

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author 99problems
December 2015

Re: Capture Google Analytics "__utma" ID in a custom dimensi

Top Contributor
# 7
Top Contributor
Thank you for clarifying.:-)
the current version of tracking code Universal analytics.js as mentioned does not use _utma
It uses the _ga cookie.
the clientID is assigned by Analytics, its a random, unique string that identifies a unique user across sessions.
It cannot identify a unique user across different browsers/devices.
You can add it's value to a custom dimension set at User scope level.
Bare in mind though, if they come back on a different browser for another session, then GA will think they are
someone different and they will get assigned a different clientID on the new/different browser.

The article is rather long however the following page has methods listed for both the older ga.js tracking using _utma and custom variables
and the current analytics.js and clientID
http://dan-russell.com/2014/03/how-to-set-a-userid-as-a-custom-variable-using-the-google-analytics-c...

I usually use the following method using Google Tag Manager , for the following reasons Simo Ahava has stated:
"You could get the Client ID from browser cookies, but if it’s a first-time visitor to your site, chances are that the cookie hasn’t been set by the time the Page View Tag fires, and you’ll miss this information. Also, if there are multiple trackers on the page, how do you know which _ga cookie to access? You don’t."
http://www.simoahava.com/analytics/improve-data-collection-with-four-custom-dimensions/#2



Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

View solution in original post

Re: Capture Google Analytics "__utma" ID in a custom dimensi

Re: Capture Google Analytics "__utma" ID in a custom dimensi

Top Contributor
# 3
Top Contributor
Hi 99problems :-)
Analytics ga.js uses _utma and custom variables.
The current Universal analytics.js does not use _utma it uses _ga and custom dimensions
Depending on what you are doing/why, you can capture the analytics clientID and use it as a custom dimension value

Are you able to give more information about the what/why you are trying to capture the _utma value

Thanks
Bronwyn
Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Capture Google Analytics "__utma" ID in a custom dimensi

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
Hello Bronwyn,

I am already capturing the client ID.

For the anonymous users, I would like to track their "GA ID" and once they are assigned to a Client ID, in my reporting, i would like to manually reassign the GD ID to the new Client ID for all the historical data.

Thanks

Re: Capture Google Analytics "__utma" ID in a custom dimensi

Top Contributor
# 5
Top Contributor
Hi :-)
Just to clarify
In your reporting, what is a client ID? Is that a number you/your system assign to them in some way?
Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Capture Google Analytics "__utma" ID in a custom dimensi

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
yes it is my web site's user ID.

some users do not have an User ID, but they have the GA ID. I would like to capture the GA User ID in a custom dimension so that if one day if they decide to register on my site. In my reporting i could manually assign the GA user ID to the Client ID.
Marked as Best Answer.
Solution
Accepted by topic author 99problems
December 2015

Re: Capture Google Analytics "__utma" ID in a custom dimensi

Top Contributor
# 7
Top Contributor
Thank you for clarifying.:-)
the current version of tracking code Universal analytics.js as mentioned does not use _utma
It uses the _ga cookie.
the clientID is assigned by Analytics, its a random, unique string that identifies a unique user across sessions.
It cannot identify a unique user across different browsers/devices.
You can add it's value to a custom dimension set at User scope level.
Bare in mind though, if they come back on a different browser for another session, then GA will think they are
someone different and they will get assigned a different clientID on the new/different browser.

The article is rather long however the following page has methods listed for both the older ga.js tracking using _utma and custom variables
and the current analytics.js and clientID
http://dan-russell.com/2014/03/how-to-set-a-userid-as-a-custom-variable-using-the-google-analytics-c...

I usually use the following method using Google Tag Manager , for the following reasons Simo Ahava has stated:
"You could get the Client ID from browser cookies, but if it’s a first-time visitor to your site, chances are that the cookie hasn’t been set by the time the Page View Tag fires, and you’ll miss this information. Also, if there are multiple trackers on the page, how do you know which _ga cookie to access? You don’t."
http://www.simoahava.com/analytics/improve-data-collection-with-four-custom-dimensions/#2



Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Capture Google Analytics "__utma" ID in a custom dimensi

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭
thank you. that looks like exactly what i needed. I will try this and let you know.

Re: Capture Google Analytics "__utma" ID in a custom dimensi

[ Edited ]
Top Contributor
# 9
Top Contributor

I have also used Dan Russell's setup for Universal analytics and the clientID in the past. I have never had any issue with it working, it can be a bit fiddly to get setup though.


Cheers

Bronwyn :-)

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Capture Google Analytics "__utma" ID in a custom dimensi

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭
i am using GTM, so i would go with Simo's post. Smiley Happy