Today, in the Blue Whale's website analysis notes, read the Google Analytics Virtual page and event tracking of the two features of the introduction, the two are event tracking (used to record no page browsing user interaction behavior). But after careful comparison there are differences, the specific summary is as follows:
1, the realization principle and way:
The virtual page is done through the _trackpageview () function. Event tracking is called the Pagetracker._trackevent () function. Both are set parameter values in the function, and when the visitor executes the event, the preset value is sent to the Google server, which is eventually displayed in the report.
2, the function of the variable value:
_trackpageview () has only one variable value, just fill out the variable values that identify the different trace events. For example: _trackpageview ("/virtual/outgoing/twitter.com") record clicks the website Twitter link event, the parameter value level divides the suggestion to have two levels above, the level directory unifies identifies the virtual page, two level directory identifies the link address.
The Pagetracker._trackevent () function sets 4 variable values, in order: event category, user behavior, event label, and event value. The first three are the values that must be filled in, and the fourth event value can be optional. For example: Pagetracker._trackevent ("Music", "Play", "Daylight Qingcheng").
The behavior of event tracking can be divided into three categories, specific to the function parameter values of the directory partition:
Site behavior: Download documents, submit comments, etc. Does not result in page browsing or the behavior of different URL pages.
Outbound Behavior: Links, Ads click. Collectively known as outbound links.
Other behaviors: Document loading, page stop, etc. The combination associated with the JS event.
3, the results of the report:
Both records of the data report are Google Analytics "content", the specific display report effect is as follows:
The event value and average value in the report are computed according to the fourth optional value within the pagetracker._trackevent () function.
4, achieve the effect:
Virtual pages produce a by-product-virtual browsing, because these virtual pages do not actually exist, but the virtual pages also generate a view in the report, affecting the accuracy of the report. So in order to maintain the authenticity of the website traffic, there should be a configuration file that does not contain virtual traffic to separate the virtual browsing volume.
Event tracking is more flexible than virtual pages in the report. You can view the performance of different categories and behaviors separately. So it is recommended that you use event tracking when tracking download behavior and other similar behaviors.
5, the specific operation:
Because the statistical code of GA is divided into traditional and asynchronous, there are two ways to add virtual pages: <a href= "http://www.zzhblog.com/.../" onclick= javascript:pagetracker._ Trackpageview ('/virtual/twitter.com '); " >follow me</a> (Virtual page Legacy Edition) <a href= "http://www.zzhblog.com/....../" onclick= ([' _ Trackpageview ', '/virtual/twitter.com ']); >follow me</a> (Virtual page Asynchronous edition) <a href= "Http://www.zzhblog.com/Cookie_Sheet.pdf" onclick= Trackevent (' ga_res ', ' Download ', ' Cookie_sheet '); " > Download </a> (Event tracking Legacy version) <a href= "Http://www.zzhblog.com/Cookie_Sheet.pdf" onclick= javascript:_gaq.push ([' _ Trackevent ', ' ga_res ', ' Download ', ' Cookie_sheet ']; > Download </a> (Event tracking asynchronous version)
above is summed up, if you have a new discovery, you can point out, share.