问题
we are seding requests like this throught the google analytics measurement protocol to track user interaction there. For us its important to be to link a interaction to a specific user so we where happy to be able to set the "cid" attribute of the protocol.
my problem is that I cannot find this Client ID somewhere inside the reports of google analytics. Even when customizing the reports I cannot find a Dimension which allows me to display this information.
http://www.google-analytics.com/collect?
v=1 // Version.
&tid=UA-XXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t=event // Event hit type
&ec=video // Event Category. Required.
&ea=play // Event Action. Required.
&cm18=8000
&cd6=crocodile
Do you have an idea of how the cid could be found there?
回答1:
Client id is assigned to a user(client) viewing your site by google analytics. Here is an example of how you can get the client id if you're using jQuery.
$(document).ready(function() {
setGaClientId();
});
var setGaClientId = function(){
if(typeof(ga) != 'undefined'){
ga(function(tracker) {
console.log(tracker.get('clientId')); //actually do something here
});
}
}
来源:https://stackoverflow.com/questions/26461439/google-analytics-how-to-get-the-client-id-anonymous-client-id-sent-with-meas