user2919190
user2919190

Reputation: 11

Google Analytics - Get Number of Session Per UserId

I'm using Google Analytics and SegmentIO in our site. I've enabled the UserId feature. Is there a way to query Google Analytics per userID? For example: get number of session per userID?

Upvotes: 1

Views: 182

Answers (2)

Andrew Andrew
Andrew Andrew

Reputation: 302

In GA you can not control user id explicitly. Try user action oriented analytic platforms like http://mixpanel.com or http://www.devmetrics.io.

For example, in devmetrics your can explicitly set user id for registered users and than your can explore all actions performed by a specific user (drilldown UI):

<html>
<head>
<!-- devmetrics.io start -->
<script type="text/javascript">
(function (doc, inst) {
window.devmetrics = inst; inst.q = inst.q || []; inst.init = function (token) { this.token = token; }; inst.userEvent = function (eventName) { inst.q.push(eventName); };
var a = doc.createElement("script"); a.type = "text/javascript"; a.src = 'http://rawgit.com/devmetrics/devmetrics-js/master/jdevmetrics.js?' + Math.floor(((new Date()).getTime() - 1442107445573) / 8640000); var e = doc.getElementsByTagName("script")[0]; e.parentNode.insertBefore(a, e);
})(document, window.devmetrics || []);
devmetrics.init("your-id");
</script>
<!-- devmetrics.io end -->

<script>
devmetrics.userEvent('page_opened');
devmetrics.setUserId(191); // set your real users id
</script>
</head>
<body>
  <button onclick="devmetrics.userEvent('button_click');">click to send event</button>
</body>
</html>

Upvotes: 0

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117301

UserId enables the analysis of groups of sessions, across devices, using a unique, persistent, and non-personally identifiable ID string representing a user.

This is an internal value used by google analytics to group your data, it is not something you can see. If you have enabled it your data should already be using it.

more info can be found here About the User ID feature

Upvotes: 1

Related Questions