开发者

Linking Google Analytics event logs to unique session ID

I've been playing with Google Analytics (& tracking events) and I'd like to be able to export my data as a raw log of [session ID, tracking event/analytics statistic] so that I can do my own classification of user sessions. All I seem to be able to do is look at ev开发者_C百科ents in aggregate, e.g. event X happened 19 times. Does anyone know if this is possible with Google Analytics? They certainly assign a unique ID, but maybe they choose not to make it possible. If not, positive experiences with MixPanel or others?

(I've seen How do I get raw logs from Google Analytics?, but that was in 2008 before their data export API was public; I'm hoping that I'm missing something.)


Custom variables are the way to go, but still there is the limitation of 50k unique values per month.

Google Analytics uses cookies that have a session ID, so you could read the "__utmb" cookie and use that value as the session identifier.

If you plan on doing deeper identified event/usage tracking, I recommend another tool.


This is one thing that I've never liked about Google Analytics. The workaround is sort of a pain... You basically need a way to identify each unique session, and Google does not provide a way to pull those unique session IDs from their API. Thus, we are forced to create our own...

Add a javascript function that checks the value of a custom variable (one that you are using as a session variable). If the value is empty, you know it's a new session. In this case, assign an incremental value to the custom variable (probably set up an extremely basic table to find get the "next" value). This way you can export whatever data you'd like broken down by session ID.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜