What is the difference between开发者_StackOverflow中文版 the two? I have an Ajax heavy site and I'm not sure which one would be more appropriate to use for tracking requests.
Event tracking is most suitable for tracking events in an application that don't necessarily cross page boundaries, such as actions implemented as Ajax calls.
Page level custom variables can be used to record user interactions, however the number of page level custom variables is limited to 5 per page. All custom variables must be defined before _trackPageview() has been called. I find session and visitor level custom variables more useful for recording extra information about a visitor such as demographics or anonymous vs logged in visits, which you can use to segment visitors.
Event Tracking would probably be better suited to AJAX interactions. Custom variables get set, then posted after ._trackPageview() is called. Event tracking can be used after you page has loaded and called ._trackPageview(), and then your user performs actions that may not result in a new page view, like AJAX calls.
精彩评论