1

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?

2 Answers2

1

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

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
0

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>
Andrew Andrew
  • 302
  • 1
  • 2