The content of the invention
In view of this, the invention provides a kind of method and device of counting user operation behavior in webpage, in webpageClick, the particular location of percussion KeyEvent and the time of user is recorded, specific behaviour of the user in this page is countedMake behavior, web site operator is preferably known user preferences and behavior, help to improve the Consumer's Experience of website.
Concrete technical scheme is as follows:
A kind of method of counting user operation behavior in webpage, including:
Default client script is loaded while the page to be counted is loaded, it is pre- in the default client scriptFirst create click event and tap KeyEvent;
When detecting user's execution clicking operation or tapping keyboard operation, call in the default client scriptCorresponding event records the peration data of the user, and the peration data includes action type, operating time and operation coordinate;
The operand according to the user in the action type of the page to be counted, operating time and operation coordinate pairAccording to being counted.
It is preferred that, the default client script is based on JavaScript.
It is preferred that, it is described when detecting user's execution clicking operation or tapping keyboard operation, call the default visitorCorresponding event in the script of family end records the peration data of the user, including:
When detecting user's execution clicking operation or tapping keyboard operation, the corresponding thing in the client script is calledPart records the operating time of the user, and the coordinate of mouse or cursor on the page to be counted during user's operation;
Newly-built one virtual gif figure, the operating time and the coordinate are recorded in the gif figures;
The gif is schemed, and operating time in the gif figures and the coordinate are packaged, as describedThe peration data of user operation case.
It is preferred that, it is described according to the user the page to be counted action type, operating time and operating positionThe peration data is counted, including:
Create and the page identical displayed page to be counted;
By the operation coordinate in user's peration data in the form of colored point in the corresponding of the displayed pagePosition is shown that the operation coordinate pair of different operating type answers the point of different colours;
Action type of the user in default multiple periods and operation coordinate are counted respectively.
The device of counting user operation behavior in a kind of webpage, including:
Loading unit, for loading default client script while the page to be counted is loaded, described defaultClick event has been pre-created in client script and KeyEvent is tapped;
Recording unit, for when detecting user's execution clicking operation or tapping keyboard operation, calling described defaultCorresponding event in client script records the peration data of the user, when the peration data includes action type, operationBetween and operation coordinate;
Statistic unit, for being sat according to the user in the action type of the page to be counted, operating time and operationMark is counted to the peration data.
It is preferred that, the client script is based on JavaScript.
It is preferred that, the recording unit includes:
Subelement is called, for when detecting user's execution clicking operation or tapping keyboard operation, calling the clientCorresponding event in the script of end records operating time of the user, and during user's operation mouse or cursor described to be countedCoordinate on the page;
Newly-built subelement, the gif figure virtual for newly-built one, the operating time and institute are recorded in the gif figuresState coordinate;
Subelement is encapsulated, for the gif to be schemed, and operating time in the gif figures and the coordinate enterRow encapsulation, is used as the peration data of the user operation case.
It is preferred that, the statistic unit includes:
Subelement is created, for creating and the page identical displayed page to be counted;
Show subelement, for by the operation coordinate in user's peration data in the form of colored point describedThe relevant position of displayed page is shown that the operation coordinate pair of different operating type answers the point of different colours;
Subelement is counted, is sat for counting action type of the user in default multiple periods and operation respectivelyMark.
Relative to prior art, beneficial effects of the present invention are as follows:
The method and device of counting user operation behavior in the webpage that the present invention is provided, write in advance comprising click event andThe client script of KeyEvent is tapped, and the client script is loaded while the page to be counted is loaded, when user holdsWhen row clicking operation or percussion keyboard operation, the corresponding event in the client script is called to record the operand of the userAccording to the peration data according to the user in the action type of the page to be counted, operating time and operation coordinate pair is enteredRow statistics.The present invention is counted to click behavior of the user in specific webpage with keyboard behavior is tapped, and statistics has moreSpecific aim, web site operator can preferably know user preferences and behavior, help to improve the Consumer's Experience of website.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, completeSite preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based onEmbodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not madeEmbodiment, belongs to the scope of protection of the invention.
Referring to Fig. 1, present embodiment discloses a kind of method of counting user operation behavior in webpage, specifically including followingStep:
S101:Default client script is loaded while the page to be counted is loaded, in the default client pinClick event has been pre-created in this and KeyEvent is tapped;
Specifically, the client script is based on JavaScript.
It should be noted that the event of click is the thing that user using some position of mouse in webpage click on generationPart, each click event correspondence one performs the user of the event, a time point and click event mouse in webpagePosition;It is that some position of user when browsing webpage in webpage taps the event that keyboard is produced to tap KeyEvent, eachTap KeyEvent correspondence one and perform the user of the event, a time point and percussion KeyEvent cursor in webpagePosition.
It is understood that the page to be counted is the page that web site operator wants statistical analysis, page to be counted is being loadedThe client script is loaded while face, the client script is run, the client script is recorded user and existThe operation behavior of the page to be counted.
S102:When detecting user's execution clicking operation or tapping keyboard operation, the default client pin is calledCorresponding event in this records the peration data of the user, and the peration data includes action type, operating time and operationCoordinate;
It should be understood that when user performs clicking operation, calling the click event in the client script;Work as userWhen performing percussion keyboard operation, the percussion KeyEvent in the client script is called.
Specifically, referring to Fig. 2, S102 one kind preferred embodiment includes:
S201:When detecting user's execution clicking operation or tapping keyboard operation, call in the client scriptCorresponding event records the operating time of the user, and the seat of mouse or cursor on the page to be counted during user's operationMark;
It should be noted that coordinate of the mouse on the page to be counted when clicking on logout user operation;StrikeThe beating keyboard logout user is marked on the coordinate on the page to be counted the operation time.
S202:Newly-built one virtual gif figure, the operating time and the coordinate are recorded in the gif figures;
S203:The gif is schemed, and operating time in the gif figures and the coordinate are packaged, asThe peration data of the user operation case.
It should be noted that peration data of the user on the page to be counted is packaged, it is easy in service end to everyThe peration data of individual encapsulation is parsed and counted.
S103:According to the user in the action type of the page to be counted, operating time and operation coordinate pairPeration data is counted.
Specifically, referring to Fig. 3, S103 one kind preferred embodiment includes:
S301:Create and the page identical displayed page to be counted;
Specifically, in the page layout of displayed page and the page to be counted, content of pages and the page between modulesDisplaying ratio is identical.
S302:By the operation coordinate in user's peration data in the form of colored point in the displayed pageRelevant position is shown that the operation coordinate pair of different operating type answers the point of different colours;
It should be noted that the displayed page can show multiple users within some period in the page to be countedOperation behavior data in face, can also show behaviour of the specific user within some period in the page to be countedMake behavioral data.
It is understood that the operation coordinate pair of different operating type answers the point of different colours, such as:The behaviour of clicking operationMaking coordinate can be with shown in red point, and the point of yellow can be shown as by tapping the operation coordinate of keyboard operation.Different coloursPoint plays a part of distinguishing the operation coordinate of different operating type.
Which web site operator can know in the page to be counted according to the distribution situation of colored point in displayed pageThe comparison that block content is concerned is more, and it is fewer which block content is concerned, and can be seen that in page same to be countedThe clicking operation of user is relatively more in content or to tap keyboard operations relatively more, further counts, and web site operator can be withKnow that specific user performs the operation of which type in some period in which of the page to be counted region, be easy to netThe network operator that stands grasps hobby and the behavior of the user.
The statistical method of user's operation behavior, enables web site operator to get information about use in this visual pageOperation behavior of the family in the page to be counted.
S303:Action type of the user in default multiple periods and operation coordinate are counted respectively.
Certainly, web site operator can also by count action type of multiple users in default multiple periods andCoordinate is operated, action type of some specific user in default multiple periods and operation coordinate can also be counted.It is thisStatistical method based on time dimension, can make web site operator analyze hobby and the behavior of user in time dimension.
It should be noted that web site operator can pre-set multiple periods according to actual needs, in these timesThe action type and operation coordinate of user are counted in section.
The method of counting user operation behavior, writes comprising click event and percussion in advance in the webpage that the present embodiment is providedThe client script of KeyEvent, and the client script is loaded while the page to be counted is loaded, when user performs pointWhen hitting operation or tapping keyboard operation, the corresponding event in the client script is called to record the peration data of the user,And the peration data is sent to service end, the service end according to the user the page to be counted operation classType, operating time and peration data described in operation coordinate pair are counted.Click of the present embodiment to user in specific webpageBehavior and percussion keyboard behavior are counted, and statistics has more specific aim, and web site operator can preferably know user preferencesAnd behavior, help to improve the Consumer's Experience of website.
Based on the method for counting user operation behavior in a kind of webpage disclosed in above-described embodiment, referring to Fig. 4, this implementationExample correspondence discloses a kind of device of counting user operation behavior in webpage, including:
Loading unit 101, for loading default client script while the page to be counted is loaded, described defaultClient script in be pre-created click event and tap KeyEvent;
Specifically, the client script is based on JavaScript.
Recording unit 102, for when detecting user's execution clicking operation or tapping keyboard operation, calling described defaultClient script in corresponding event record the peration data of the user, the peration data includes action type, operationTime and operation coordinate;
It is preferred that, the recording unit 102 includes:
Subelement is called, for when detecting user's execution clicking operation or tapping keyboard operation, calling the clientCorresponding event in the script of end records operating time of the user, and during user's operation mouse or cursor described to be countedCoordinate on the page;
Newly-built subelement, the gif figure virtual for newly-built one, the operating time and institute are recorded in the gif figuresState coordinate;
Subelement is encapsulated, for the gif to be schemed, and operating time in the gif figures and the coordinate enterRow encapsulation, is used as the peration data of the user operation case.
Statistic unit 103, for according to the user the page to be counted action type, operating time and operationPeration data is counted described in coordinate pair.
It is preferred that, the statistic unit 103 includes:
Subelement is created, for creating and the page identical displayed page to be counted;
Show subelement, for by the operation coordinate in user's peration data in the form of colored point describedThe relevant position of displayed page is shown that the operation coordinate pair of different operating type answers the point of different colours;
Subelement is counted, is sat for counting action type of the user in default multiple periods and operation respectivelyMark.
The device of counting user operation behavior in webpage disclosed in the present embodiment, user can be recorded automatically in the specific pageIn clicking operation and tap keyboard operation, and to click behavior of the user in the specific page and tap keyboard behavior and carry outStatistics, statistics has more specific aim, and web site operator can preferably know user preferences and behavior, helps to improve websiteConsumer's Experience.
The foregoing description of the disclosed embodiments, enables professional and technical personnel in the field to realize or using the present invention.A variety of modifications to these embodiments will be apparent for those skilled in the art, as defined hereinGeneral Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, it is of the inventionThe embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase oneThe most wide scope caused.