Client point reporting method, device, electronic device and storage medium
By using the first attribute and the second attribute in the DOM node to determine whether the dot data has been sent, the problem of repeated reporting of dot data on the client is solved, and the accuracy of the data and the simplification of the development process are achieved.
Patent Information
- Application Number
- CN202011364706.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-27
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-11-27
AI Technical Summary
In the existing technology, the client is prone to repeated reporting of data when reporting dotted data, making it difficult to ensure data accuracy. Especially during page scrolling or click events, the process of maintaining two lists to avoid repeated reporting is complex and error-prone.
By adding the first attribute to the target Document Object Model (DOM) node to indicate the parameters that need to be dotted and the second attribute to indicate that the dotted log has been sent, when monitoring the trigger event of the target page, obtain the DOM node and identify whether it contains the second attribute. If If not, log information is generated and sent, and a second attribute is added when sending to mark it as sent, ensuring that the data is only reported once.
It effectively avoids repeated reporting of data, ensures the accuracy of data management, and writes DOM nodes in the form of attributes during the development phase, simplifying the development process and reducing complexity.
Smart Images

Figure CN112486770B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a method, device, electronic device and storage medium for reporting client points. Background Art
[0002] Dots are business data information recorded when a view changes due to user operations. Dot data can be used to analyze products and operations. After obtaining dot data, the client uploads the dot data to the server. The server can perform statistics based on the data reported by the client so as to perform data mining based on the statistical data. Therefore, it is crucial to avoid duplicate data reporting to ensure the accuracy of the data to be reported. Summary of the invention
[0003] The present disclosure provides a client point reporting method, device, electronic device and storage medium to at least solve the problem of how to avoid repeated data reporting in the related art to ensure the accuracy of the event information data to be reported. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a method for reporting a point on a client is provided, comprising:
[0005] When a target trigger event occurs in a target page, a target document object model DOM node in the target page is acquired, wherein the target document object model DOM node includes a first attribute, and the first attribute is used to indicate a parameter to be marked;
[0006] Identify whether the target document object model DOM node contains a second attribute, wherein the second attribute is used to indicate that the dot log has been sent;
[0007] In response to the target document object model DOM node not containing the second attribute, acquiring corresponding data to be reported according to the first attribute; and
[0008] Generate corresponding log information according to the data to be reported, and send the log information to the server.
[0009] In some embodiments of the present disclosure, when sending the log information to the server, the method further includes:
[0010] The second attribute is added to the target document object model DOM node.
[0011] In some embodiments of the present disclosure, the target triggering event includes:
[0012] Any of the page scroll trigger event and click trigger event.
[0013] In the embodiment of the present disclosure, the target trigger event is the page scroll trigger event; and the step of identifying whether the target document object model DOM node contains the second attribute includes:
[0014] Identify whether the location of the target document object model DOM node is within the visible window;
[0015] In response to the current position of the target document object model DOM node being within the visible window, it is identified whether the target document object model DOM node contains a second attribute.
[0016] In an embodiment of the present disclosure, there are multiple target document object model DOM nodes; the step of identifying whether the target document object model DOM node contains the second attribute includes:
[0017] For each of the target document object model DOM nodes, identifying whether the position of the current target DOM node is within the visible window;
[0018] If the position of the current target DOM node is within the visible window, it is identified whether the current target DOM node contains a second attribute.
[0019] In some embodiments of the present disclosure, the step of obtaining a target document object model DOM node in the target page includes:
[0020] Get all Document Object Model (DOM) nodes in the target page;
[0021] Finding a DOM node including the first attribute from all the document object model DOM nodes;
[0022] The DOM node including the first attribute is determined as the target document object model DOM node.
[0023] According to a second aspect of an embodiment of the present disclosure, a client point reporting device is provided, comprising:
[0024] A first acquisition unit is configured to acquire a target document object model DOM node in the target page when a target trigger event occurs in the target page, wherein the target document object model DOM node includes a first attribute, and the first attribute is used to indicate a parameter to be marked;
[0025] an identification unit configured to identify whether the target document object model DOM node contains a second attribute, wherein the second attribute is used to indicate that the dot log has been sent;
[0026] A second acquisition unit is configured to, in response to the target document object model DOM node not containing the second attribute, acquire corresponding data to be reported according to the first attribute;
[0027] a generating unit, configured to generate corresponding log information according to the data to be reported; and
[0028] The sending unit is configured to send the log information to a server.
[0029] In some embodiments of the present disclosure, the device further includes:
[0030] The adding unit is configured to add the second attribute to the target document object model DOM node when the sending unit sends the log information to the server.
[0031] In some embodiments of the present disclosure, the target triggering event includes:
[0032] Any of the page scroll trigger event and click trigger event.
[0033] In some embodiments of the present disclosure, the target trigger event is the page scrolling trigger event; and the identification unit is specifically configured to:
[0034] Identify whether the location of the target document object model DOM node is within the visible window;
[0035] In response to the current position of the target document object model DOM node being within the visible window, it is identified whether the target document object model DOM node contains a second attribute.
[0036] In some embodiments of the present disclosure, there are multiple target document object model DOM nodes; the identification unit is specifically configured to:
[0037] For each of the target document object model DOM nodes, identifying whether the position of the current target DOM node is within the visible window;
[0038] If the position of the current target DOM node is within the visible window, it is identified whether the current target DOM node contains a second attribute.
[0039] In some embodiments of the present disclosure, the first acquisition unit is specifically configured as follows:
[0040] Get all Document Object Model (DOM) nodes in the target page;
[0041] Finding a DOM node including the first attribute from all the document object model DOM nodes;
[0042] The DOM node including the first attribute is determined as the target document object model DOM node.
[0043] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0044] processor;
[0045] a memory for storing instructions executable by the processor;
[0046] The processor is configured to execute the instructions to implement the client point reporting method described in the first aspect.
[0047] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the client point reporting method described in the first aspect.
[0048] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided. When instructions in the computer program product are executed by a processor, the client point reporting method described in the first aspect is executed.
[0049] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0050] When a target trigger event occurs in the target page, the target DOM node in the target page is obtained, wherein the target DOM node includes a first attribute, and the first attribute is used to indicate the parameters that need to be marked; whether the target DOM node contains a second attribute, wherein the second attribute is used to indicate that the marking log has been sent, in response to the target DOM node not containing the second attribute, the corresponding data to be reported is obtained according to the first attribute, and the corresponding log information is generated according to the data to be reported, and the log information is sent to the server. Thus, the embodiment of the present disclosure finds the DOM node element that needs to be marked from the target page through the first attribute, and determines whether the DOM node element has sent the marking log to the server through the second attribute, so that the reporting number of the marking data of the DOM node element can be guaranteed, so that it is guaranteed to be reported once, thereby avoiding repeated reporting of data, thereby ensuring the accuracy of the reported data. In addition, in the development stage, it is only necessary to write the marking data to the DOM in the page in the form of attributes, that is, by adding two attributes to the DOM node, it is possible to send element marking when the page target event is triggered and one element is reported once, which greatly reduces the complexity of the development process.
[0051] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0053] Figure 1 The figure is a flow chart of a method for reporting a point on a client according to an exemplary embodiment.
[0054] Figure 2 The figure is a flowchart of a method for reporting a point on a client according to another exemplary embodiment.
[0055] Figure 3 The figure is a flowchart of a method for reporting a point on a client according to another exemplary embodiment.
[0056] Figure 4 The figure is a flowchart of a method for reporting a point on a client according to another exemplary embodiment.
[0057] Figure 5 The present invention is a block diagram of a client point reporting device according to an exemplary embodiment.
[0058] Figure 6 The present invention is a block diagram of a client point reporting device according to another exemplary embodiment.
[0059] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0060] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0061] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0062] It should be noted that dotting is one of the commonly used methods of data statistics. It is an action on the client to report the data of the user's operation behavior on the area of interest to the server. The server can perform statistics based on the data reported by the client so as to perform data mining based on the statistical data. It can be understood that there are usually two ways to dot a page: one is the click dot method, and the other is the exposure dot method. Among them, for the click dot method, when a click trigger event occurs on the page, the dot operation can be performed on the page; for the scroll dot method, when a scroll trigger event occurs on the page, the dot elements that appear in the visible window of the screen will be reported to the exposure log.
[0063] For example, in the actual development process of daily operational activities, the page height is often too long. If you want to know the exposure of a module in the page, you need to make the module appear in the visible window of the screen and send a log report request to analyze user data behavior. The specific method is as follows: create a first list, which is used to maintain the elements that need to be marked and the log report parameters; create a second list, which is used to subsequently maintain the marked elements of the sent logs, where the second list is an empty list when created. Listen to the page scrolling method, loop through the first list, judge each element, calculate whether the current element position is in the visible window, if it is in the visible window, continue to judge whether it is in the second list, if not in the second list, send a mark log report request for the element, if it is in the second list, it means that the exposure point of the element has been sent, and there is no need to send the log request again.
[0064] However, the above-mentioned dotting method requires maintaining two lists. In projects based on the front-end component library VUE, whether the modules in the subcomponent are in the visible window requires additional judgment of the hierarchy and index value. The development process is too complicated and prone to errors.
[0065] In order to solve the problem of how to avoid repeated data reporting to ensure the accuracy of the data to be reported and reduce the complexity of the development process, the present disclosure proposes a client point reporting method, device, electronic device and storage medium. Specifically, the client point reporting method, device, electronic device and storage medium of the present disclosure embodiment are described below with reference to the accompanying drawings.
[0066] Figure 1 FIG. 1 is a flow chart of a method for reporting a point on a client according to an exemplary embodiment. Figure 1 As shown, the client point reporting method is used in the client point reporting device of the embodiment of the present disclosure, and the client point reporting device is configured in an electronic device. The client point reporting method includes the following steps.
[0067] In step S11, when a target triggering event occurs in a target page, a target document object model (DOM) node in the target page is obtained.
[0068] In the embodiment of the present disclosure, the target DOM node may include but is not limited to the first attribute, etc. The first attribute is used to indicate the parameter to be marked.
[0069] For example, during the development phase of the target page, when creating a DOM node in the target page, the parameters that need to be marked can be written to the DOM node in the form of attributes, for example, the agreed attribute is kwai-auto-log. As an example, the code form of writing the parameters that need to be marked to the DOM node in the form of attributes can be expressed as follows:
[0070] <div kwai-auto-log="{action:’model1-show’,params:{index:1,type:1}}”> .
[0071] That is to say, during the development phase of the target page, a DOM node of the target page can be created, and the corresponding parameters that need to be marked can be written to the DOM node in the form of attributes according to the marking requirements. In this way, the attribute is used to indicate that the DOM node needs to be marked and reported, and the marked data is the data corresponding to the parameters in the attribute.
[0072] As an example, when the user browses the target page, the client can report the target page log. At this time, the target page can be monitored to see whether a target trigger event occurs. When the target trigger event occurs in the target page, all DOM nodes in the target page can be obtained, and all DOM nodes containing the first attribute can be found from all DOM nodes, and all DOM nodes containing the first attribute can be determined as target DOM nodes.
[0073] That is to say, when a target triggering event occurs in the target page, all DOM nodes that need to be marked can be found from the target page based on the first attribute. These DOM nodes that need to be marked are the target DOM nodes.
[0074] It should be noted that, in some embodiments of the present disclosure, the target page may be an HTML (HyperText Markup Language, Hypertext Markup Language) page, or an H5 (HyperText Markup Language 5, HTML5) page. As an example, the target page may be an H5 page.
[0075] In step S12, it is identified whether the target document object model DOM node contains a second attribute, wherein the second attribute is used to indicate that the dot log has been sent.
[0076] In the disclosed embodiment, the second attribute can be used to indicate that a dot log has been sent to the server. The dot log can be understood as a log containing data to be reported. In this step, when the target DOM node in the target page is obtained, it can be determined whether the target DOM node contains the second attribute to determine whether it is necessary to report the dot log for the target DOM node.
[0077] In one embodiment of the present disclosure, if it is determined that the target DOM node contains the second attribute, it means that the target DOM node has previously sent a dot log, and there is no need to send the dot log to the server. If it is determined that the target DOM node does not have the second attribute, it means that the target DOM node has not yet sent a dot log, and step S13 can be executed at this time.
[0078] In step S13, in response to the target document object model DOM node not containing the second attribute, the corresponding data to be reported is obtained according to the first attribute.
[0079] Optionally, when the target DOM node is not identified as having the second attribute, it may be indicated that the target DOM node has not sent a dotting log. At this time, the data to be reported corresponding to the parameter to be dotted in the first attribute contained in the target DOM node may be obtained. As an example, the specific content of the data to be reported may be determined by the dotting requirements. For example, the data to be reported may include but is not limited to the user's behavior data, such as the behavior data may be any one or more of the number of comments, video viewing time, and video viewing times.
[0080] In step S14, corresponding log information is generated according to the data to be reported, and the log information is sent to the server.
[0081] Optionally, based on the parameter format of the log, the data to be reported is written to the corresponding position of the log to obtain log information generated by the data to be reported. Then, a log request can be sent to the server to send the log information to the server based on the request, so that the server can perform statistics based on the reported data in the log information, so as to perform data mining based on the statistical data.
[0082] In some embodiments of the present disclosure, when sending log information to a server, a second attribute may be added to a target document object model DOM node. That is, when sending the dot log for the target DOM node to the server, the second attribute is added to the target DOM node so as to indicate that the target DOM node has sent the dot log to the server through the second attribute. Thus, by adding a second attribute to the DOM node to indicate that the dot log has been sent, the reporting times of the dot data of the DOM node element are guaranteed, so that it is guaranteed to be reported once, so as to avoid repeated reporting of data, thereby ensuring the accuracy of the reported data.
[0083] According to the client dotting reporting method of the embodiment of the present disclosure, when a target triggering event occurs in the target page, the target DOM node in the target page is obtained, wherein the target DOM node includes a first attribute, and the first attribute is used to indicate the parameter that needs to be dotted; it is identified whether the target DOM node contains a second attribute, wherein the second attribute is used to indicate that the dotting log has been sent, and in response to the target DOM node not containing the second attribute, the corresponding data to be reported is obtained according to the first attribute, and the corresponding log information is generated according to the data to be reported, and the log information is sent to the server. Thus, the embodiment of the present disclosure finds the DOM node element that needs to be dotted from the target page through the first attribute, and determines whether the DOM node element has sent the dotting log to the server through the second attribute, so that the reporting number of the dotting data of the DOM node element can be guaranteed, so that it is guaranteed to be reported once, so that the data can be avoided from being reported repeatedly, so that the accuracy of the reported data can be guaranteed. In addition, in the development stage, it is only necessary to write the dotting data to the DOM in the page in the form of attributes, that is, by adding two attributes to the DOM node, it is possible to send element dotting when the page target event is triggered and report one element once, which greatly reduces the complexity of the development process.
[0084] It should be noted that in some embodiments of the present disclosure, the target trigger event may include any one of a page scroll trigger event and a click trigger event. That is, the client dotting reporting method of the embodiment of the present disclosure may be applicable to a page scroll exposure dotting scenario, or may also be applicable to a page click dotting scenario. In order to facilitate those skilled in the art to understand the implementation of these two scenarios, examples of these two scenarios are given below.
[0085] Figure 2 is a flow chart of a method for reporting a point on a client according to another exemplary embodiment. In the embodiment of the present disclosure, the target trigger event is a page scrolling trigger event. That is, the embodiment of the present disclosure takes the scenario of applying to page scrolling exposure and dotting as an example. Figure 2 As shown, the client point reporting method includes the following steps.
[0086] In step S21, when a page scroll triggering event occurs in the target page, a target DOM node in the target page is obtained.
[0087] In the embodiment of the present disclosure, the target DOM node includes a first attribute, and the first attribute is used to represent the parameter that needs to be marked.
[0088] In step S22, it is identified whether the position of the target DOM node is within the visible window.
[0089] Optionally, since the exposure point needs to require that the position of the element to be pointed appears in the visible window of the client screen, that is, when the position of the element to be pointed appears in the visible window, the exposure point is triggered. Therefore, when obtaining the DOM node (that is, the target DOM node) containing the first attribute in the target page, it can be first determined whether the position of the target DOM node is in the visible window of the screen.
[0090] It should be noted that there are many ways to determine whether the position of the target DOM node is within the visible window of the screen. As an example, the height difference value can be obtained by subtracting the height of the visible window from the height of the target DOM node from the top, and then determining whether the height difference value is less than or equal to the height of the target DOM node itself. If so, it is determined that the position of the target DOM node is within the visible window. It is understandable that there are other ways to determine whether the position of the target DOM node is within the visible window of the screen, which will not be repeated here.
[0091] In the embodiment of the present disclosure, if the height difference is greater than the height of the target DOM node itself, it means that the position of the target DOM node is not within the visible window, which means that the target DOM node does not currently meet the conditions for exposure and marking, that is, the target DOM node is not exposed and marked at this time. When the target DOM node is within the visible window, the target DOM node needs to be exposed and marked, thereby achieving the purpose of exposing and marking the page scrolling elements.
[0092] In step S23, in response to the current position of the target DOM node being within the visible window, it is identified whether the target DOM node contains a second attribute, wherein the second attribute is used to indicate that the dot log has been sent.
[0093] That is, when the current position of the target DOM node is within the visible window, it can be determined whether the target DOM node contains a second attribute indicating that a dot log has been sent. In some embodiments of the present disclosure, if it is determined that the target DOM node contains a second attribute indicating that a dot log has been sent, it means that the target DOM node has already sent a dot log to the server, and at this time, there is no need to expose and dot the target DOM node again to avoid duplicate data reporting.
[0094] In step S24, in response to the target DOM node not containing the second attribute, the corresponding data to be reported is obtained according to the first attribute.
[0095] Optionally, when it is determined that the second attribute in the target DOM node has not been changed, it means that the target DOM node has not been exposed and marked, that is, the target DOM node has not sent a marking log to the server. At this time, the data to be reported corresponding to the parameter required to be marked in the first attribute contained in the target DOM node can be obtained.
[0096] In step S25, corresponding log information is generated according to the data to be reported, and the log information is sent to the server.
[0097] In step S26, the second attribute is added to the target DOM node.
[0098] According to the client dotting reporting method of the embodiment of the present disclosure, the purpose of exposure dotting of page scrolling elements can be achieved, that is, when a page scrolling triggering event occurs in the target page, the DOM node element that needs to be dotted is found from the target page through the first attribute, and the second attribute is used to determine whether the DOM node element has sent a dotting log to the server, which can ensure the reporting number of dotting data of the DOM node element, so that it is guaranteed to be reported once, thereby avoiding repeated reporting of data, thereby ensuring the accuracy of the reported data. In addition, in the development stage, it is only necessary to write the dotting data to the DOM in the page in the form of attributes, that is, by adding two attributes to the DOM node, it is possible to issue element dotting when the page target event is triggered and report one element once, which greatly reduces the complexity of the development process.
[0099] Figure 3 is a flow chart of a method for reporting client-side marking according to another exemplary embodiment. In the disclosed embodiment, there are multiple target document object model DOM nodes. At this time, it can be determined one by one whether each target DOM node meets the conditions for exposure marking. If it meets the conditions, the current target DOM node is exposed and marked. If it does not meet the conditions, there is no need to report the marking data of the current target DOM node. Specifically, Figure 3 As shown, the client point reporting method includes the following steps.
[0100] In step S31, when a page scroll triggering event occurs in the target page, multiple target DOM nodes in the target page are acquired.
[0101] In the embodiment of the present disclosure, each target DOM node includes a first attribute, and the first attribute is used to represent the parameter that needs to be marked.
[0102] In step S32, for each target DOM node, it is identified whether the current target DOM node is within the visible window.
[0103] Optionally, the multiple target DOM nodes are traversed to determine whether the position of the current target DOM node is within the visible window. If the position of the current target DOM node is not within the visible window, the next target DOM node is read, that is, the position of the next target DOM node is determined to be within the visible window. If the position of the current target DOM node is within the visible window, step S33 is executed.
[0104] In step S33, it is identified whether the current target DOM node contains the second attribute.
[0105] That is, when it is determined that the position of the current target DOM node is within the visible window, it is determined whether the current target DOM node contains the second attribute. If it is determined that the current target DOM node contains the second attribute, it means that the current target DOM node has sent a dot log, and the next target DOM node can be read at this time, that is, it is determined whether the position of the next target DOM node is within the visible window. If it is determined that the current target DOM node does not have the second attribute, step S34 is executed.
[0106] In step S34, corresponding data to be reported is obtained according to the first attribute.
[0107] That is, when it is determined that the position of the current target DOM node is within the visible window and the current target DOM node does not have the second attribute, the corresponding data to be reported can be obtained according to the dot parameter in the first attribute of the current target DOM node.
[0108] In step S35, corresponding log information is generated according to the data to be reported, and the log information is sent to the server.
[0109] That is to say, the data to be reported for the current target DOM node can be sent to the server in the form of logs to complete the exposure of the current target DOM node.
[0110] In step S36, the second attribute is added to the current target DOM node.
[0111] That is, when the dotting log information of the current target DOM node is sent to the server, a second attribute may be added to the current target DOM node to indicate that the current target DOM node has been exposed and dotted, so as to avoid repeated dotting of the DOM node.
[0112] According to the client dotting reporting method of the embodiment of the present disclosure, when a page scrolling trigger event occurs in the target page, multiple target DOM nodes in the target page are obtained, and multiple target DOM nodes can be written into a list to obtain a DOM node list, and each target DOM node in the DOM node list is traversed in a loop, and it is determined whether the position of the current traversed target DOM node is within the visible window. If not, the next target DOM node is read, that is, it is determined whether the position of the next target DOM node is within the visible window. If the position of the current target DOM node is within the visible window, it is determined whether the current target DOM node contains a second attribute. If it is determined that the current target DOM node contains the second attribute, it means that the current target DOM node has sent a dotting log. At this time, the next target DOM node can be read, that is, it is determined whether the position of the next target DOM node is within the visible window; if it is determined that the current target DOM node does not have the second attribute, the current target DOM node is exposed and dotted, that is, the dot data of the current target DOM node is sent to the server in the form of a log. If each target DOM node in the DOM node list has been read, it means that the scrolling exposure dotting of the target page has been completed, and the process can be exited at this time. Therefore, by finding out all DOM nodes with the first attribute in the target page, and judging one by one whether the DOM node contains the second attribute, if there is no second attribute, the dot log is reported for the current DOM node, that is, all DOM node elements that need to be dotted are found from the target page through the first attribute, and the second attribute is used to judge whether the DOM node elements have sent dot logs to the server. The reporting number of dot data of the DOM node elements can be guaranteed, so that it is guaranteed to be reported once, thereby avoiding repeated reporting of data, thereby ensuring the accuracy of the reported data.
[0113] Figure 4 is a flow chart of a method for reporting a client click according to another exemplary embodiment. In the embodiment of the present disclosure, the target trigger event is a click trigger event. That is, the embodiment of the present disclosure takes the scenario of applying to page clicks as an example. Figure 4 As shown, the client point reporting method includes the following steps.
[0114] In step S41, when a click trigger event occurs in the target page, a target document object model DOM node in the target page is obtained.
[0115] In the embodiment of the present disclosure, the target document object model DOM node includes a first attribute, and the first attribute is used to represent the parameter that needs to be marked.
[0116] In step S42, it is identified whether the target document object model DOM node contains a second attribute, wherein the second attribute is used to indicate that the dot log has been sent.
[0117] In step S43, in response to the target document object model DOM node not containing the second attribute, the corresponding data to be reported is obtained according to the first attribute.
[0118] In step S44, corresponding log information is generated according to the data to be reported, and the log information is sent to the server.
[0119] In some embodiments of the present disclosure, when sending log information to a server, a second attribute may be added to a target document object model DOM node.
[0120] According to the client dotting reporting method of the embodiment of the present disclosure, the purpose of page click dotting can be achieved, that is, when a click trigger event occurs in the target page, the DOM node element that needs to be dotted is found from the target page through the first attribute, and the second attribute is used to determine whether the DOM node element has sent a dotting log to the server, which can ensure the reporting number of dotting data of the DOM node element, so that it is guaranteed to be reported once, thereby avoiding repeated reporting of data, thereby ensuring the accuracy of the reported data. In addition, in the development stage, it is only necessary to write the dotting data to the DOM in the page in the form of attributes, that is, by adding two attributes to the DOM node, it is possible to achieve the issuance of element dotting when the page target event is triggered and one element is reported once, which greatly reduces the complexity of the development process.
[0121] Figure 5 FIG. 1 is a block diagram of a client point reporting device according to an exemplary embodiment. Figure 5 The device includes: a first acquisition unit 501, an identification unit 502, a second acquisition unit 503, a generation unit 504 and a sending unit 505.
[0122] Specifically, the first acquisition unit 501 is configured to acquire a target document object model DOM node in the target page when a target trigger event occurs in the target page, wherein the target document object model DOM node includes a first attribute, and the first attribute is used to represent the parameter to be marked. In the embodiment of the present disclosure, the target trigger event may include any one of a page scroll trigger event and a click trigger event.
[0123] As an example, the first acquisition unit 501 acquires all document object model DOM nodes in the target page, finds out the DOM node containing the first attribute from all the document object model DOM nodes, and determines the DOM node containing the first attribute as the target document object model DOM node.
[0124] The identification unit 502 is configured to identify whether the target document object model DOM node contains a second attribute, wherein the second attribute is used to indicate that the dot log has been sent. In some embodiments of the present disclosure, the target trigger event is a page scroll trigger event. In the embodiments of the present disclosure, the identification unit 502 is specifically configured to: identify whether the position of the target document object model DOM node is within the visible window; in response to the current position of the target document object model DOM node being within the visible window, identify whether the target document object model DOM node contains the second attribute.
[0125] In the embodiment of the present disclosure, when there are multiple target document object model DOM nodes, the specific implementation process of the identification unit 502 identifying whether the target document object model DOM node contains the second attribute can be as follows: for each target document object model DOM node, identify whether the position of the current target DOM node is within the visible window; if the position of the current target DOM node is within the visible window, identify whether the current target DOM node contains the second attribute.
[0126] The second acquisition unit 503 is configured to, in response to the target document object model DOM node not containing the second attribute, acquire the corresponding data to be reported according to the first attribute.
[0127] The generating unit 504 is configured to generate corresponding log information according to the data to be reported.
[0128] The sending unit 505 is configured to send the log information to the server.
[0129] In some embodiments of the present disclosure, Figure 6 As shown, the client-side reporting device may further include: an adding unit 606. The adding unit 606 is configured to add the second attribute to the target document object model DOM node when the sending unit 605 sends the log information to the server. Figure 6 601-605 and Figure 5 501-505 have the same function and structure.
[0130] Regarding the device in the above embodiment, the specific way in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here. According to the client dotting reporting device of the embodiment of the present disclosure, when a target trigger event occurs in the target page, the target DOM node in the target page is obtained, wherein the target DOM node includes a first attribute, and the first attribute is used to indicate the parameters that need to be dotted; whether the target DOM node contains a second attribute, wherein the second attribute is used to indicate that the dotting log has been sent, in response to the target DOM node not containing the second attribute, the corresponding data to be reported is obtained according to the first attribute, and the corresponding log information is generated according to the data to be reported, and the log information is sent to the server. Therefore, the embodiment of the present disclosure finds the DOM node element that needs to be dotted from the target page through the first attribute, and judges whether the DOM node element has sent the dotting log to the server through the second attribute, so that the reporting number of the dotting data of the DOM node element can be guaranteed, so that it is guaranteed to be reported once, thereby avoiding repeated reporting of data, thereby ensuring the accuracy of the reported data. In addition, during the development phase, you only need to write the dot data to the DOM in the page in the form of attributes. That is, by adding two attributes to the DOM node, you can issue an element dot when the page target event is triggered and report one element at a time, which greatly reduces the complexity of the development process.
[0131] In order to implement the above embodiment, the present disclosure also provides an electronic device, Figure 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0132] Reference Figure 7 , the electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .
[0133] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.
[0134] The memory 704 is configured to store various types of data to support operations on the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0135] The power supply component 706 provides power to the various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 700.
[0136] The multimedia component 708 includes a touch screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the touch screen may include a liquid crystal display (LCD) and a touch panel (TP). The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0137] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the electronic device 700 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.
[0138] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0139] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 can detect the open / closed state of the electronic device 700, the relative positioning of components, such as the display and keypad of the electronic device 700, and the sensor assembly 714 can also detect the position change of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and the temperature change of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0140] The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0141] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned client point reporting method.
[0142] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by a processor 720 of an electronic device 700 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0143] A non-temporary computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device 700, enables the electronic device 700 to execute a client point reporting method.
[0144] A computer program product. When instructions in the computer program product are executed by a processor of an electronic device 700, the electronic device 700 can execute a client point reporting method.
[0145] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0146] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for reporting a point on a client, characterized in that: include: When a target trigger event occurs in a target page, a target document object model DOM node in the target page is acquired, wherein the target document object model DOM node includes a first attribute, and the first attribute is used to indicate a parameter to be marked; Identify whether the target document object model DOM node contains a second attribute, wherein the second attribute is used to indicate that a dot log has been sent, and the dot log is a log containing data to be reported; In response to the target document object model DOM node not containing the second attribute, acquiring the corresponding data to be reported according to the first attribute; and Generate corresponding log information according to the data to be reported, and send the log information to the server; When sending the log information to the server, the method further includes: The second attribute is added to the target document object model DOM node.
2. The client point reporting method according to claim 1, characterized in that: The target triggering events include: Any of the page scroll trigger event and click trigger event.
3. The client point reporting method according to claim 2, characterized in that: The target trigger event is the page scroll trigger event; The step of identifying whether the target document object model DOM node contains a second attribute includes: Identify whether the location of the target document object model DOM node is within the visible window; In response to the current position of the target document object model DOM node being within the visible window, it is identified whether the target document object model DOM node contains a second attribute.
4. The client point reporting method according to claim 3, characterized in that: The target document object model DOM node is multiple; the identifying whether the target document object model DOM node contains the second attribute includes: For each of the target document object model DOM nodes, identifying whether the position of the current target DOM node is within the visible window; If the position of the current target DOM node is within the visible window, it is identified whether the current target DOM node contains a second attribute.
5. The client point reporting method according to any one of claims 1 to 4, characterized in that: The step of obtaining a target document object model DOM node in the target page includes: Get all Document Object Model (DOM) nodes in the target page; Finding a DOM node including the first attribute from all the document object model DOM nodes; The DOM node including the first attribute is determined as the target document object model DOM node.
6. A client point reporting device, characterized in that: include: A first acquisition unit is configured to acquire a target document object model DOM node in the target page when a target trigger event occurs in the target page, wherein the target document object model DOM node includes a first attribute, and the first attribute is used to indicate a parameter to be marked; an identification unit configured to identify whether the target document object model DOM node contains a second attribute, wherein the second attribute is used to indicate that a dot log has been sent, and the dot log is a log containing data to be reported; A second acquisition unit is configured to, in response to the target document object model DOM node not containing the second attribute, acquire the corresponding data to be reported according to the first attribute; a generating unit, configured to generate corresponding log information according to the data to be reported; and A sending unit, configured to send the log information to a server; The device further comprises: The adding unit is configured to add the second attribute to the target document object model DOM node when the sending unit sends the log information to the server.
7. The client point reporting device according to claim 6, characterized in that: The target triggering events include: Any of the page scroll trigger event and click trigger event.
8. The client point reporting device according to claim 7, characterized in that: The target trigger event is the page scroll trigger event; the identification unit is specifically configured to: Identify whether the location of the target document object model DOM node is within the visible window; In response to the current position of the target document object model DOM node being within the visible window, it is identified whether the target document object model DOM node contains a second attribute.
9. The client point reporting device according to claim 8, characterized in that: The target document object model DOM node is multiple; the identification unit is specifically configured as follows: For each of the target document object model DOM nodes, identifying whether the position of the current target DOM node is within the visible window; If the position of the current target DOM node is within the visible window, it is identified whether the current target DOM node contains a second attribute.
10. The client point reporting device according to any one of claims 6 to 9, characterized in that: The first acquisition unit is specifically configured as follows: Get all Document Object Model (DOM) nodes in the target page; Finding a DOM node including the first attribute from all the document object model DOM nodes; The DOM node including the first attribute is determined as the target document object model DOM node.
11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the client point reporting method according to any one of claims 1 to 5.
12. A storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the client point reporting method according to any one of claims 1 to 5.
13. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the client point reporting method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Non-tracking data statistic method and system of mobile device, terminal and medium
CN108197002A
Data encryption reporting method and device and data decryption method and device
CN109474619A
Behavior data reporting method, device and equipment and storage medium
CN109635210A
Information reporting method and device for elements on page, electronic equipment and storage medium
CN111159600A
