The content of the invention
In view of this, this specification one or more embodiment provides a kind of page events acquisition method and device, with fast
The fast succinct deployment realized page events and gathered, and improve the degree of accuracy of event acquisition.
Specifically, this specification one or more embodiment is achieved by the following technical solution:
First aspect, there is provided a kind of page events acquisition method, methods described include:
The page listened in the page clicks on the click event of element;
Obtain the page and click on tree-like path information corresponding to element, the tree-like path information is used to represent the page
Millet cake hits node location of the element in tree-shaped descriptive model corresponding to the page;
This click event is reported, and carries the tree-like path information.
Second aspect, there is provided a kind of page events acquisition method, methods described include:
The click event in the page of collection is obtained, the page that the click event includes clicking on clicks on the tree-shaped road of element
Footpath information, the tree-like path information are used to represent that the page clicks on element in tree-shaped descriptive model corresponding to the page
Node location;
The tree-like path information is parsed, the page is obtained and clicks on element.
The third aspect, there is provided a kind of page events harvester, described device include:
Action listener module, the click event of element is clicked on for listening to the page in the page;
Data obtaining module, tree-like path information corresponding to element, the tree-like path are clicked on for obtaining the page
Information is used to represent that the page clicks on node location of the element in tree-shaped descriptive model corresponding to the page;
Reporting events module, for reporting this click event, and carry the tree-like path information.
Fourth aspect, there is provided a kind of page events harvester, described device include:
Event receiving module, the click event in the page for obtaining collection, the click event include the page clicked on
Millet cake hits the tree-like path information of element, and the tree-like path information is used to represent that the page clicks on element in the page pair
Node location in the tree-shaped descriptive model answered;
Event parsing module, for parsing the tree-like path information, obtain the page and click on element.
5th aspect, there is provided a kind of data acquisition equipment, the equipment includes memory, processor, and is stored in
Following steps are realized on reservoir and the computer instruction that can run on a processor, during the computing device instruction:
The page listened in the page clicks on the click event of element;
Obtain the page and click on tree-like path information corresponding to element, the tree-like path information is used to represent the page
Millet cake hits node location of the element in tree-shaped descriptive model corresponding to the page;
This click event is reported, and carries the tree-like path information.
6th aspect, there is provided a kind of data processing equipment, the equipment includes memory, processor, and is stored in
Following steps are realized on reservoir and the computer instruction that can run on a processor, during the computing device instruction:
The click event in the page of collection is obtained, the page that the click event includes clicking on clicks on the tree-shaped road of element
Footpath information, the tree-like path information are used to represent that the page clicks on element in tree-shaped descriptive model corresponding to the page
Node location;
The tree-like path information is parsed, the page is obtained and clicks on element.
The page events acquisition method and device of this specification one or more embodiment, by being listened to by collector
During click event, obtain the page and click on tree-like path information corresponding to element, by the path information submission, service end can according to
Know that the page clicks on element in the position of the page according to the routing information.This method allows developer need not be in page generation
The station location marker of a little each page elements is buried in code, but by the automatic acquisition approach information reporting of collector, then for
For developer, the workload buried a little is reduced, can the quickly succinct deployment for realizing page events collection;And may be used also
To improve the degree of accuracy of page events collection, it can understand and accurately distinguish different page elements.
Embodiment
In order that those skilled in the art more fully understand the technical scheme in this specification one or more embodiment,
Below in conjunction with the accompanying drawing in this specification one or more embodiment, to the technology in this specification one or more embodiment
Scheme is clearly and completely described, it is clear that described embodiment is only part of the embodiment, rather than whole realities
Apply example.Based on this specification one or more embodiment, those of ordinary skill in the art are not making creative work premise
Lower obtained every other embodiment, it should all belong to the scope of the application protection.
Fig. 1 illustrates a page, as shown in figure 1, can include " page click element " and " page click in the page
Element ".For example, it can be that button in the page, link etc. can allow the element of user's click that the page, which clicks on element, its in the page
The element of his type is properly termed as page click element, such as the width background picture that can be shown in webpage or one
Section word.
Assuming that to gather the behavior that user browses the above-mentioned page according to business demand, such as, can gather that user clicks on should
The page on the page clicks on the number of element " link ", to understand interest-degree of the user to the linked contents.It is possible to the page
" collector " is set in the page code in face, for example, the collector can be javascript scripts.When the browser resolves page
When code shows the page, above-mentioned js scripts are can also carry out, js scripts can perform the page events acquisition method of this example,
The click event whether occurred to link is monitored, and reports service end to carry out statistical analysis.User clicks on and once " linked ", can be with
Referred to as one click event.
Page events collection in disclosure example, DOM Tree (dom trees) that can be based on the page.Using the h5 pages as
Example, is described, the language describes page elements information with a kind of tree when the h5 pages are write using html language.Browser wash with watercolours
When contaminating the page, html can be converted to dom trees, for describing page elements information, and provide operation API.For example, it is as follows
One section of html page code corresponding to Fig. 1 page, wherein, simply signal framework in following code, a part of content is to omit
Number or asterisk band mistake, no longer show:
Above-mentioned page code can be converted to dom trees, and the dom trees are properly termed as tree-shaped descriptive model corresponding to the page.
Such as Fig. 2 illustrates the dom trees, a part for the tree-shaped descriptive model is equally also merely illustrated.The page shown in Fig. 2 is corresponding
Tree-shaped descriptive model, and the page shown in Fig. 1, and page code above, corresponding relation can be formed between three.
For example, by taking " button " in Fig. 1 pages as an example, it is that a page clicks on element to be somebody's turn to do " button ", and the element can be right
Answer in page code<button>….</button>, while the element can also correspond in Fig. 2 dom tree-models
" button " node.
In another example by taking " link " in Fig. 1 pages as an example, it is somebody's turn to do " link " and a page clicks on element, the element can
With in corresponding page code<A href=" # ">….</a>, while the element can also correspond in Fig. 2 dom tree-models
" a " node arranged side by side with " button " node.
By foregoing description it can be seen that, page elements in the page can to should be in the dom tree-models of the page some
Node, and the node can also find corresponding code position in page code.Based on above-mentioned corresponding relation, this example
Page elements can be described in the position of the page according to dom tree-models.For example dom tree-models corresponding to a page can be with
The page is represented, and the position of some node in dom tree-models in the model is stated, and can represent the page corresponding to node
Station location marker of the element in the page.
Fig. 3 illustrates the flow of the page events acquisition method of disclosure example, and this method can be that browser performs js
Script performs, and the js scripts can be referred to as into collector, as shown in figure 3, this method can include:
In step 300, the page listened in the page clicks on the click event of element.
In this example, collector can monitor the page and click on whether element is clicked on by user upon execution, for example, can supervise
Listen whether " link " in the page is clicked.When user clicks on, collector can listen to that there occurs click event.
For example, the page of this example, can be the tree that the native pages or the h5 pages etc. can get the page
The page of shape model so that the element position in the page can be represented by tree-like path information.
In step 302, obtain the page and click on tree-like path information corresponding to element, the tree-like path information is used
Node location of the element in tree-shaped descriptive model corresponding to the page is clicked in representation page.
In this step, the dom tree-models of the page can generally provide access interface, can be divided by the access interface
The page in step 300 is not got clicks on each hierarchy node of the element belonging in tree-shaped descriptive model.Such as with page point
Hit exemplified by element " button ", the node " button " in the element corresponding diagram 2, the node can be got by access interface
The father node of " button "<div>, the father node can also be obtained<div>Last layer father node again, etc..It will can get
Each hierarchy node combination, obtain the page click on element corresponding to tree-like path information, the tree-like path information be used for represent page
Millet cake hits node location of the element in tree-shaped descriptive model corresponding to the page.
For example, still so that the above-mentioned page clicks on element " button " as an example, being somebody's turn to do the tree-like path information of " button " can be:
div-div2-button.From the point of view of Fig. 2, wherein, div can be<body>Under child node<div>, div2 can be
One div child node, and the div of example has two child node div arranged side by side in Fig. 2, and button is that compliance is left-to-right
Order second div under child node.Therefore, the composition of the tree-like path information can be, by the node of each level
Separated with "-", and per hierarchy node mark include nodename (for example, div) and to should node lookup sequence number (example
Such as, " 2 " in div2, represent there may be the node of multiple levels side by side, this node div is second).
In another example with page code above "<A href=" # ">" exemplified by, with reference to Fig. 2, corresponding tree-like path
Information can be " div-a ", represent<body>Under be directly connected to<div>Under child node<a>.For another example in page code
"<A href=" # ">….</a>" corresponding to tree-like path information can be " div-div2-a ", expression first find<body>
Under child node<div>, then second div child node that left-to-right order is complied with the child node under the div is found, finally
Child node is found in child node under second div child node<a>.
It can see by above-mentioned, tree-like path information corresponding to page click element illustrates the position that the page clicks on element
Accessed path, and can be that the mode that the page clicks on element corresponding node is sequentially found in dom trees corresponding to the page,
The page can certainly be searched in page code according to the tree-like path information and clicks on code position corresponding to element, principle phase
Together.In addition, this example does not limit the specific representation of tree-like path information, above-mentioned " div-div2-button " is only one
Individual example;The method that collector obtains the tree-like path information can not also be limited, as long as the position of page elements can be obtained
Put accessed path.
In step 304, this click event is reported, and carries the tree-like path information.
For example, the tree-like path information reporting that collector can click on the page corresponding to this click event element extremely takes
Business end, for example can report to and bury dot system, to carry out statistical analysis according to these information, it can be realized that user clicks on these
The related data of element, for example get number of clicks.
The page events acquisition method of this example, it can obtain the page by collector when listening to click event and click on
Tree-like path information corresponding to element, the routing information are equivalent to a kind of mark of element in page location, the path are believed
Breath reports, and service end can knows that the page clicks on element in the position of the page according to the routing information.This method to develop
Personnel can need not bury the station location marker of a little each page elements in page code, but by the automatic acquisition approach of collector
Information reporting, then for developer, reduce the workload buried a little, quickly succinct can realize page thing
The deployment of part collection;And decrease and bury an intrusion degree of the collection to page code.
In addition, the method for this example can also improve the degree of accuracy of page events collection, it is being related to the page interaction of complexity
When, for example, under the same page, because the operation of the operation of user, or page script causes page elements to change,
It can be understood by the method for this example and accurately distinguish different page elements.It is exemplified below:Assuming that in some page
At same page location, several Zhang Butong picture is shown in the automatic carousel in the position according to business demand, then this several
Picture is actually to be shown in same page location.Sub method according to the present example, page elements are described according to the dom trees of the page
Path when, although these pictures are shown in same page location, their node locations in dom trees are different, because
The tree-like path information of this picture got is just different, so as to accurately distinguish the element buried a little, also causes follow-up
During statistical analysis, it can make it that the result of statistics is more accurate.
Again, event is clicked on using this method collection page, due to no longer needing the injection in page code to need to gather
The page click on the station location marker of element, eliminate line and give a definition and manage and bury the work that element position identifies, simplify industry
Business product development process;Also, the position of element is clicked on by the tree-like path message identification page, not only positional representation is more clear
Clear, routing information inherently can clearly describe element in the position of the page, and the acquisition modes of routing information are simpler
It is single quick, the introductory path information of element can be got by the access interface of tree shaped model.
In another example, other page elements outside element are clicked on for the page in the page, equally can profit
Click event acquisition is carried out with the page events acquisition method of the disclosure.For example, can be that other page elements set " click
Report attribute ", as long as there is the element of the attribute, corresponding event can be monitored.Fig. 4 illustrates another page events and adopted
The flow chart of diversity method, it can include:
In step 400, the click event of other page elements in the page is listened to.
For example, js scripts can monitor the click event of page elements, when user's browsing pages, being somebody's turn to do on the page is clicked
During the position of page elements, that is, click event occurs.
In step 402, if the page elements report attribute including click, obtain and set corresponding to the page elements
Shape routing information, and report the click event for including the tree-like path information.
If for example, the attribute of the page elements, which includes click, reports attribute, exemplary, the attribute for example can be
Data-click, then js scripts can obtain tree-like path information corresponding to page elements according to the flow shown in Fig. 3, and report
Service end.
The page events acquisition method of this example, when to click on thing to some specific page elements collection, very
Easily deployment is realized, it is only necessary to which the position addition click of the page elements reports attribute in page code, it is not necessary to
The station location marker of the page elements is injected in page code, it is achieved that simply.
In above-mentioned example, it is described how set the click event to page elements to be acquired, gather click event
Can be in order to carry out statistical analysis to the navigation patterns of user, so as to as the improved foundation of business.So in collection event
Afterwards, statistical analysis can also be carried out to each click event collected, in one example, such as the thing that will can be collected
Part, which reports to, buries dot system, and the processing of statistical analysis is carried out by burying dot system.Fig. 5 illustrates the flow to event analysis processing,
, can be according to the collection event information reverting received to corresponding page elements in the processing procedure.This method can include:
In step 500, the click event in the page of collection is obtained, the page that the click event includes clicking on is clicked on
The tree-like path information of element.
For example, the event data for the click event that the module for being responsible for statistical analysis can be reported with the js scripts of receiving front-end,
The page that the event data can include click event clicks on tree-like path information corresponding to element, and the routing information is used to represent
The page clicks on node location of the element in tree-shaped descriptive model corresponding to the page.The different pages is clicked on tree-shaped corresponding to element
Routing information can be different.
In step 502, the tree-like path information is parsed, the page is obtained and clicks on element.
This step is according to tree-like path information reverse resolution, and member is clicked on to reduce the page corresponding to this click event
Element.For example, still by taking the reverse resolution that the page in the page exemplified by Fig. 1 clicks on element " link " as an example, it is corresponding to be somebody's turn to do " link "
Tree-like path information can be div-div2-a.
It is possible, firstly, to decompose tree-like path information div-div2-a, using "-" as separator, obtain the page and click on element
Each hierarchy node belonging in tree-shaped descriptive model, including:div、div2、a.And each hierarchy node is parsed,
Implication including character therein and numeral, such as, div is represented by the root node of tree-shaped descriptive model, look into downwards successively
Look for, first obtained node div;Div2 represents the child node under first above-mentioned node div, also, the child node
Multiple div can be included, div2 here represents second child node div;A represents the child node under div2.Synthesis obtains,
First a node element under second div under first div element of div-div2-a representation pages.
Then, each hierarchy node that can be obtained according to parsing, is successively obtained in tree-shaped descriptive model or page code
Take, determine that the page clicks on element.Such as it is illustrated in Figure 6, it can successively be searched in dom trees, first find " 1 " mark
Div, the div of " 2 " mark is then found, be eventually found the node " a " of " 3 " mark, the as page clicks on element.Or such as Fig. 7
Signal, by taking page code as an example, still according to " 1 " --->“2”——>The step of " 3 ", searches successively, finally gives code
Position<A href=" # ">….</a>.Whether the code position in Fig. 7 or the node in Fig. 6 " a ", finally all corresponding diagram
The page in 1 page clicks on element " link ".
In addition, in statistical analysis, the practical business product page is can be combined with, the page got is indicated on the page
Element is clicked on, such as, obtained in parsing after corresponding to tree-like path information being the element " link " in Fig. 1 on the page, can general
It is somebody's turn to do " link " to show to protrude color, intuitively sees that click event occurs in the position of the page so as to which personnel must be analyzed and understood.
Also, can also show the page click on element corresponding to click event event data, such as can near " link " or
Page location is waited above person's element, shows the number that the element is clicked.
The page events acquisition method of this example, by representing element in reporting events with the tree-like path information of element
In the position of the page, because the tree-like path information has the feature of semanteme to element position in itself so that can be quick and precisely
Find element corresponding to routing information in the position of the page, the corresponding reduction work of position is simple and quick, and can also enter
Row visualization display, statistic analysis are very directly perceived.
In order to realize the page events acquisition method of this specification one or more embodiment, Fig. 8 provides a kind of page
Event acquisition device, the device for example apply the js scripts in collection event.It can include:Action listener module 81, information obtain
Modulus block 82 and reporting events module 83.
Action listener module 81, the click event of element is clicked on for listening to the page in the page;
Data obtaining module 82, tree-like path information corresponding to element, the tree-shaped road are clicked on for obtaining the page
Footpath information is used to represent that the page clicks on node location of the element in tree-shaped descriptive model corresponding to the page;
Reporting events module 83, for reporting this click event, and carry the tree-like path information.
In one example, the action listener module 81, it is additionally operable to listen to the page described in the page and clicks on member
The click event of page elements outside element;
Described information acquisition module 82, it is additionally operable to when the page elements report attribute including click, then described in acquisition
Tree-like path information corresponding to page elements.
In order to realize the page events acquisition method of this specification one or more embodiment, Fig. 9 additionally provides a kind of page
Face event acquisition device, the device, which is for example applied, is burying the statistical analysis module of dot system.The device can include:Event receives
Module 91 and event parsing module 92.
Event receiving module 91, the click event in the page for obtaining collection, the click event include what is clicked on
The page clicks on the tree-like path information of element, and the tree-like path information is used to represent that the page clicks on element in the page
Node location in corresponding tree-shaped descriptive model;
Event parsing module 92, for parsing the tree-like path information, obtain the page and click on element.
In one example, as shown in Figure 10, the device can also include:Data disaply moudle 93, in the page
The page got is indicated on face and clicks on element, and shows that the page clicks on the event number of click event corresponding to element
According to.
Each step shown in above-mentioned page events acquisition method embodiment in flow, its execution sequence are not restricted to flow
Order in journey figure.In addition, the description of each step, it is possible to achieve be software, hardware or its form combined, for example, originally
Art personnel can implement these as the form of software code, can be that can realize logic function corresponding to the step
Computer executable instructions.When it is realized in a manner of software, described executable instruction can store in memory,
And by the computing device in equipment.
For example, corresponding to the above method, this specification one or more embodiment provides a kind of data acquisition equipment simultaneously,
The computer instruction that the equipment can include processor, memory and storage on a memory and can run on a processor,
The processor is by performing the instruction, for realizing following steps:The page listened in the page clicks on the click of element
Event;Obtain the page and click on tree-like path information corresponding to element, the tree-like path information is used to represent the page
Click on node location of the element in tree-shaped descriptive model corresponding to the page;This click event is reported, and described in carrying
Tree-like path information.In the realization of an example, the data acquisition equipment can be a computer, be run on the computer
The browser-presented page, and browser also gathers click event of the user to page elements and reported.
For example, corresponding to the above method, this specification one or more embodiment provides a kind of data processing equipment simultaneously,
The computer instruction that the equipment can include processor, memory and storage on a memory and can run on a processor,
The processor is by performing the instruction, for realizing following steps:Obtain the click event in the page of collection, the point
The page that hitting event includes clicking on clicks on the tree-like path information of element, and the tree-like path information is used to represent the page point
Hit node location of the element in tree-shaped descriptive model corresponding to the page;The tree-like path information is parsed, is obtained described
The page clicks on element.In the realization of an example, the data processing equipment can be server, can be run on the server
Dot system is buried, burying dot system can analyze and process to the collection event received.
The device or module that above-described embodiment illustrates, can specifically be realized by computer chip or entity, or by with
The product of certain function is realized.One kind typically realizes that equipment is computer, and the concrete form of computer can be personal meter
Calculation machine, laptop computer, cell phone, camera phone, smart phone, personal digital assistant, media player, navigation are set
It is any several in standby, E-mail receiver/send equipment, game console, tablet PC, wearable device or these equipment
The combination of equipment.
For convenience of description, it is divided into various modules during description apparatus above with function to describe respectively.Certainly, this is being implemented
The function of each module can be realized in same or multiple softwares and/or hardware during specification one or more embodiment.
It should be understood by those skilled in the art that, this specification one or more embodiment can be provided as method, system or
Computer program product.Therefore, this specification one or more embodiment can use complete hardware embodiment, complete software to implement
The form of embodiment in terms of example or combination software and hardware.Moreover, this specification one or more embodiment can be used one
Individual or multiple computer-usable storage mediums for wherein including computer usable program code (include but is not limited to disk storage
Device, CD-ROM, optical memory etc.) on the form of computer program product implemented.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability
Comprising so that process, method, commodity or equipment including a series of elements not only include those key elements, but also wrapping
Include the other element being not expressly set out, or also include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that wanted including described
Other identical element also be present in the process of element, method, commodity or equipment.
This specification one or more embodiment can computer executable instructions it is general on
Described in hereafter, such as program module.Usually, program module includes performing particular task or realizes particular abstract data type
Routine, program, object, component, data structure etc..Can also put into practice in a distributed computing environment this specification one or
Multiple embodiments, in these DCEs, by being performed by communication network and connected remote processing devices
Task.In a distributed computing environment, the local and remote computer that program module can be located at including storage device is deposited
In storage media.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.Adopted especially for data
For collecting equipment or data processing equipment embodiment, because it is substantially similar to embodiment of the method, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims
It is interior.In some cases, the action recorded in detail in the claims or step can be come according to different from the order in embodiment
Perform and still can realize desired result.In addition, the process described in the accompanying drawings not necessarily require show it is specific suitable
Sequence or consecutive order could realize desired result.In some embodiments, multitasking and parallel processing be also can
With or be probably favourable.
The preferred embodiment of this specification one or more embodiment is the foregoing is only, not limiting this public affairs
Open, it is all within the spirit and principle of the disclosure, any modification, equivalent substitution and improvements done etc., it should be included in the disclosure
Within the scope of protection.