A method and apparatus for handling a buried point
By selecting the identifier of the first element on the tracking information configuration page, similar elements are automatically identified and configuration files are generated, solving the problem of high-cost tracking data collection in existing technologies and realizing low-cost tracking data collection and analysis.
Patent Information
- Application Number
- CN202310544822.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-15
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-05-15
AI Technical Summary
In existing technologies, writing the software code corresponding to data tracking requires significant R&D and maintenance costs. Furthermore, when the application logic of the web application or the collected data tracking data changes, the code needs to be rewritten, further increasing the cost.
By selecting the identifier of the first element on the event tracking information configuration page, similar elements are automatically identified and event tracking configuration files are generated, reducing reliance on the server and lowering R&D and maintenance costs.
Data collection can be achieved without writing software code, reducing R&D and maintenance costs and improving the efficiency of data collection analysis.
Smart Images

Figure CN116484131B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a method and device for handling a buried point. BACKGROUND
[0002] Buried point analysis is a common data collection method for website analysis. For a web application, a developer or an operation and maintenance personnel can write software code corresponding to a buried point, and run the software code on the web application, so as to collect running data corresponding to the web application.
[0003] However, the method of writing software code corresponding to a buried point for data collection needs to consume a large amount of research and development and operation and maintenance costs. On the one hand, writing software code corresponding to a buried point needs to consume a certain amount of research and development costs. In addition, when the application logic of the web application changes or the buried point data to be collected changes, the software code corresponding to the buried point needs to be re-written, thereby consuming a large amount of operation and maintenance costs.
[0004] Therefore, there is an urgent need for a solution to solve the above problems. SUMMARY
[0005] In order to solve or at least partially solve the above technical problems, the embodiments of the present application provide a method and device for handling a buried point.
[0006] In a first aspect, the embodiments of the present application provide a method for handling a buried point, the method comprising:
[0007] In response to a selection operation triggered in a buried point information configuration page for a first element, obtaining an identifier of the first element, the first element being an element in a page to be analyzed;
[0008] According to the identifier of the first element, determining a plurality of second elements in the page to be analyzed, the second elements being the same type of elements as the first element;
[0009] Sending the identifier of the first element, the identifier of at least one second element of the plurality of second elements, and target configuration information configured in the buried point information configuration page to a server, so that the server generates a buried point configuration file corresponding to the page to be analyzed based on the identifier of the first element, the identifier of the at least one second element, and the target configuration information, the buried point configuration file being used for collecting buried point data of the page to be analyzed.
[0010] Optionally, the identification of the first element comprises a path position of the first element, the path position comprising path information and first position information, the path information indicating that an element path of the first element comprises N levels, N being an integer greater than 1, and the first position information indicating that a label name of the first element corresponds to a number at each of the levels respectively, wherein the N levels comprise a first level, the first level comprising at least one element having the label name, and the number of the label name of the first element at the first level indicating a number of the first element in the at least one element having the label name, and the determining the plurality of second elements in the page to be analyzed according to the identification of the first element comprises:
[0011] replacing the first number in the first position information with a preset path wildcard to obtain second position information, the preset path wildcard indicating that the first number is ignored;
[0012] determining the plurality of second elements according to the second position information and the path information.
[0013] Optionally, the replacing the first number in the first position information with a preset path wildcard to obtain second position information comprises:
[0014] replacing, in a preset order, the numbers corresponding to the N levels in the first position information with preset path wildcards respectively to obtain the second position information corresponding to the N levels respectively, the numbers corresponding to the N levels in the first position information comprising the first number.
[0015] Optionally, the identification of the first element comprises a first Cascading Style Sheet (CSS) selector of the first element, and the determining the plurality of second elements in the page to be analyzed according to the identification of the first element comprises:
[0016] determining a candidate CSS selector according to the first CSS selector;
[0017] determining a relative CSS path between the first CSS selector and the candidate CSS selector;
[0018] determining the plurality of second elements according to the candidate CSS selector and the relative CSS selector.
[0019] Optionally, the determining the candidate CSS selector according to the first CSS selector comprises:
[0020] determining the candidate CSS selector corresponding to each of M iterations respectively through M iterations, M being an integer greater than 1; wherein:
[0021] In the first iteration, the first parent cascading style sheet selector of the first cascading style sheet selector is determined as the candidate cascading style sheet selector corresponding to the first iteration.
[0022] In the i-th iteration, the cascading style sheet selector that has an inheritance relationship with the candidate cascading style sheet selector determined in the (i-1)-th iteration is determined as the candidate cascading style sheet selector corresponding to the i-th iteration, where i is an integer greater than 1 and less than or equal to M.
[0023] Optionally, obtaining several second elements from the page to be analyzed based on the identifier of the first element includes:
[0024] In response to the automatic acquisition operation of similar elements triggered in the event tracking information configuration page, several second elements in the page to be analyzed are determined based on the identifier of the first element.
[0025] Optionally, the method further includes:
[0026] Show the aforementioned several second elements;
[0027] In response to a selection operation triggered for at least one second element among the plurality of elements, the identifier of the at least one second element is obtained.
[0028] Optionally, the target configuration information includes one or more of the following:
[0029] The event type corresponding to the data collection, the triggering condition for the data collection, and the attribute value corresponding to the data collection element, wherein the data collection element includes the first element and the at least one second element.
[0030] Secondly, embodiments of this application provide a method for embedding data points, the method comprising:
[0031] Receive the event tracking configuration file sent by the server, wherein the event tracking configuration file is any one of the event tracking configuration files described in the first aspect above;
[0032] Obtain the target event from the page to be analyzed, and match the target event with the event tracking configuration file;
[0033] If the target event matches the event tracking configuration file, the tracking data corresponding to the target event is collected.
[0034] Thirdly, embodiments of this application provide a data embedding processing device, the device comprising:
[0035] The first obtaining unit is configured to obtain an identifier of a first element in response to a selection operation triggered for the first element in a page information configuration page, the first element being an element in a page to be analyzed;
[0036] The determining unit is configured to determine a plurality of second elements in the page to be analyzed according to the identifier of the first element, the second elements being same-type elements of the first element;
[0037] The sending unit is configured to send the identifier of the first element, the identifier of at least one second element of the plurality of second elements, and target configuration information configured in the page information configuration page to a server, so that the server generates a page configuration file corresponding to the page to be analyzed based on the identifier of the first element, the identifier of the at least one second element, and the target configuration information, the page configuration file being used for page data collection of the page to be analyzed.
[0038] Optionally, the identifier of the first element includes a path position of the first element, the path position including path information and first position information, the path information indicating that an element path of the first element includes N levels, N being an integer greater than 1, and the first position information indicating that a label name of the first element corresponds to a number at each of the levels, respectively, wherein the N levels include a first level, the first level including at least one element having the label name, the number of the first element corresponding to the first level indicating a number of the first element in the at least one element having the label name, and the determining unit is configured to:
[0039] replace a first number in the first position information with a preset path wildcard to obtain second position information, the preset path wildcard indicating that the first number is ignored.
[0040] determine the plurality of second elements according to the second position information and the path information.
[0041] Optionally, the replacing the first number in the first position information with the preset path wildcard to obtain the second position information includes:
[0042] replacing, in a preset order, numbers corresponding to each of the N levels in the first position information with the preset path wildcard to obtain the second position information corresponding to each of the N levels, respectively, the numbers corresponding to each of the N levels in the first position information including the first number.
[0043] Optionally, the identifier of the first element includes a first cascading style sheet selector of the first element, and the determining unit is configured to:
[0044] Based on the first cascading style sheet selector, determine the cascading style sheet selector to be selected;
[0045] Determine the relative cascading style sheet path between the first cascading style sheet selector and the candidate cascading style sheet selector;
[0046] The plurality of second elements are determined based on the candidate cascading style sheet selector and the relative cascading style sheet selector.
[0047] Optionally, determining the candidate Cascading Style Sheet selector based on the first Cascading Style Sheet selector includes:
[0048] The candidate cascading style sheet selectors are determined through M iterations, where M is an integer greater than 1; where:
[0049] In the first iteration, the first parent cascading style sheet selector of the first cascading style sheet selector is determined as the candidate cascading style sheet selector corresponding to the first iteration.
[0050] In the i-th iteration, the cascading style sheet selector that has an inheritance relationship with the candidate cascading style sheet selector determined in the (i-1)-th iteration is determined as the candidate cascading style sheet selector corresponding to the i-th iteration, where i is an integer greater than 1 and less than or equal to M.
[0051] Optionally, the determining unit is used for:
[0052] In response to the automatic acquisition operation of similar elements triggered in the event tracking information configuration page, several second elements in the page to be analyzed are determined based on the identifier of the first element.
[0053] Optionally, the device further includes:
[0054] A display unit is used to display the plurality of second elements;
[0055] The second acquisition unit is configured to acquire the identifier of the at least one second element in response to a selection operation triggered for at least one second element among the plurality of elements.
[0056] Optionally, the target configuration information includes one or more of the following:
[0057] The event type corresponding to the data collection, the triggering condition for the data collection, and the attribute value corresponding to the data collection element, wherein the data collection element includes the first element and the at least one second element.
[0058] In a fourth aspect, an embodiment of the present application provides a device for processing a buried point, the device comprising:
[0059] a receiving unit configured to receive a buried point configuration file sent by a server, the buried point configuration file being the buried point configuration file in any one of the first aspect above;
[0060] a obtaining unit configured to obtain a target event in the page to be analyzed, and match the target event with the buried point configuration file;
[0061] a collecting unit configured to collect buried point data corresponding to the target event, in a case where the target event is successfully matched with the buried point configuration file.
[0062] In a fifth aspect, an embodiment of the present application provides a device for processing a buried point, the device comprising a processor and a memory;
[0063] The processor is configured to execute instructions stored in the memory, so that the device performs the method in any one of the first aspect above, or so that the device performs the method in the second aspect above.
[0064] In a sixth aspect, an embodiment of the present application provides a computer readable storage medium comprising instructions, the instructions instructing a device to perform the method in any one of the first aspect above, or the instructions instructing the device to perform the method in the second aspect above.
[0065] In a seventh aspect, an embodiment of the present application provides a computer program product, when the computer program product is run on a computer, the computer program product causes the computer to perform the method in any one of the first aspect above, or the computer program product causes the computer to perform the method in the second aspect above.
[0066] Compared with the prior art, the embodiments of the present application have the following advantages:
[0067] The embodiment of the present application provides a method for processing a burying point. In one example, the method can be applied to a first client. The first client can display a burying point information configuration page, and the burying point information configuration page can display a first element in a page to be analyzed. A user can trigger a selection operation for the first element in the burying point information configuration page, and accordingly, the first client can acquire an identifier of the first element in response to the selection operation triggered for the first element. Further, based on the identifier of the first element, a plurality of second elements in the page to be analyzed are determined, the second elements are homogeneous elements of the first element, and further, the identifier of the first element, an identifier of at least one second element of the plurality of second elements, and target configuration information configured in the burying point information configuration page are sent to a server, so that the server generates a burying point configuration file corresponding to the page to be analyzed based on the identifier of the first element, the identifier of the at least one second element and the target configuration information, and the burying point configuration file is used for collecting burying point data of the page to be analyzed. As can be seen, by using the present solution, the user can select the first element in the burying point information configuration page, and after the user selects the first element, the first client can automatically obtain a plurality of homogeneous elements of the first element, so that the server generates a burying point configuration file used for collecting burying point data of the page to be analyzed based on the first element, at least one second element and target configuration information configured in the burying point information configuration page. By using the present solution, the user does not need to write corresponding software code, and can only make corresponding configuration in the visual burying point information configuration page, and for homogeneous elements, the user only needs to select one element (the first element) in the burying point information configuration page, thereby effectively reducing the research and development and operation and maintenance cost of burying point analysis of the page to be analyzed.
[0068] Correspondingly, the second client can receive the burying point configuration file sent by the server, and use the burying point configuration file to perform burying point analysis on the page to be analyzed. In one specific example, the second client can acquire a target event in the page to be analyzed, and match the target event with the burying point configuration file. If the target event is successfully matched with the burying point configuration file, the second client can collect burying point data corresponding to the target event. By using the present solution, burying point analysis of the page to be analyzed can be implemented with less research and development and operation and maintenance cost. BRIEF DESCRIPTION OF DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0070] Figure 1 An exemplary application scenario schematic diagram provided for the embodiments of the present application;
[0071] Figure 2 A flowchart of a method for processing a buried point provided for the embodiments of the present application;
[0072] Figure 3 A flowchart of a method for determining a second element provided for the embodiments of the present application;
[0073] Figure 4 A DOM structure diagram of a page to be analyzed provided for the embodiments of the present application;
[0074] Figure 5 A flowchart of another method for determining a second element provided for the embodiments of the present application;
[0075] Figure 6 A DOM structure diagram of a page to be analyzed provided for the embodiments of the present application;
[0076] Figure 7 A flowchart of a method for processing a buried point provided for the embodiments of the present application;
[0077] Figure 8 A structure schematic diagram of a buried point processing device provided for the embodiments of the present application;
[0078] Figure 9 A structure schematic diagram of another buried point processing device provided for the embodiments of the present application. DETAILED DESCRIPTION
[0079] In order to make the person skilled in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0080] The various non-limiting embodiments of the present application will be described in detail below in conjunction with the drawings.
[0081] Exemplary method
[0082] Referring to Figure 1 , Figure 1 An exemplary application scenario provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, a first client 110 can interact with a server 120. A user can configure a page analysis configuration on the first client 110. Correspondingly, the server 120 generates a page analysis configuration file based on the page analysis configuration configured by the user on the first client 110, and delivers the page analysis configuration file to a second client 130. The second client can collect page analysis data based on the page analysis configuration file, and report the collected page analysis data to a data processing end 140. Figure 1
[0083] Next, a page analysis method provided by the embodiments of the present application is introduced.
[0084] Referring to Figure 2 , this figure is a flowchart of a page analysis method provided by the embodiments of the present application. Figure 2 The page analysis method shown in FIG. 2 can be applied to a first client. In this embodiment, the method can include the following steps: S201-S203.
[0085] S201: In response to a selection operation triggered on a page analysis configuration page for a first element, obtaining an identifier of the first element, the first element being an element in a page to be analyzed.
[0086] The first client can display the page analysis configuration page, which can be a page corresponding to a page analysis configuration platform. A user can use the page analysis configuration platform to configure page analysis configuration information of the page to be analyzed in a visual manner, so as to collect page analysis data of the page to be analyzed.
[0087] In this embodiment, the page analysis configuration page can display at least one page element in the page to be analyzed, for example, the page analysis configuration page displays the page to be analyzed, or for example, the page analysis configuration page displays at least one page element in the page to be analyzed that supports page analysis. The at least one page element can include the first element, or in other words, the first element can be one of the at least one page element.
[0088] In the embodiment of the present application, the user can select the first element in the page to trigger a selection operation. The embodiment of the present application does not limit the specific implementation of the selection operation triggered by the user on the first element. For example, the user can select the first element in the page, or the user can trigger a double-click operation on the first element, and the like, which are not listed one by one here.
[0089] After the user triggers the selection operation on the first element, the first client can obtain the identifier of the first element in response to the selection operation triggered on the first element. The identifier of the first element is used to uniquely identify the first element in the page to be analyzed.
[0090] In one example, the identifier of the first element can be a path position of the first element. The path position can include path information and first position information. Wherein:
[0091] The path information is used to indicate the element path of the first element. In one example, the element path of the first element can include N levels, where N is an integer greater than 1. For example, the element path of the first element is: / body / ... / tbody / tr / td / div / span, where span is the tag name of the first element.
[0092] The first position information is used to indicate the corresponding number of the tag name of the first element at each level. Taking the first level in the plurality of levels as an example, the first level can include at least one element having the tag name, and the corresponding number of the tag name of the first element at the first level can be the number of the first element in the at least one element having the tag name at the first level. For example, if the first level includes only one element having the tag name, i.e., there is no other element at the first level having the same tag name as the first element, the corresponding number of the tag name of the first element at the first level can be 0. For another example, if the first level includes two elements having the tag name, i.e., there is another element at the first level having the same tag name as the first element, the corresponding number of the tag name of the first element at the first level can be 0 or 1. In the case where the element path of the first element is: / body / ... / tbody / tr / td / div / span, the first position information can be, for example: ['0',..., '0', '1', '3', '0', '0'].
[0093] In yet another example, the identification of the first element can be a first Cascading Style Sheets Selector (CSS Selector) of the first element.
[0094] In one example, considering the web page, the identification of the page element of some web pages is more appropriate to use path location, while the identification of the element of some web pages is more appropriate to use CSS Selector. Therefore, in one example, the first client can obtain the path location of the first element and the first CSS Selector, and display the path location of the first element and the first CSS Selector, and the user selects one of the path location of the first element and the first CSS Selector as the identification of the first element.
[0095] S102: According to the identification of the first element, determine a plurality of second elements in the page to be analyzed, the second element being a same type element of the first element.
[0096] In the embodiments of the present application, considering that the page to be analyzed can include many same type elements, and in some scenarios, the user's demand for same type element is the same or similar. Therefore, in the embodiments of the present application, in order to improve the efficiency of the user setting the burying point configuration information, after the user triggers the selection operation for the first element, the first client can automatically obtain the same type elements of the first element in the page to be analyzed according to the identification of the first element, to obtain a plurality of second elements, without the user triggering the selection operation for the same type elements of the first element one by one in the burying point information configuration page.
[0097] In one example, the first client can default to start the "same type element automatic acquisition" function, and for this case, the first client can determine the plurality of second elements according to the identification of the first element after obtaining the identification of the first element.
[0098] In yet another example, the user can determine whether to start the "same type element automatic acquisition" function. In one specific example, the user can trigger the same type element automatic acquisition operation in the burying point information configuration page, and correspondingly, the first client can further determine the plurality of second elements in response to the same type element automatic acquisition operation after obtaining the identification of the first element. Wherein, the user triggers the same type element automatic acquisition operation in the burying point information configuration page can be understood as that the user starts the foregoing "same type element automatic acquisition" function.
[0099] As mentioned earlier, the identifier of the first element can be either the path location of the first element or the first CSS Selector of the first element. When the identifier of the first element is the path location of the first element, the specific implementation of S102 can be found in the description of S1021-S1022 below, and will not be described in detail here. When the identifier of the first element is the first CSS Selector of the first element, the specific implementation of S102 can be found in the description of S1023-S1025 below, and will not be described in detail here.
[0100] S103: Send the identifier of the first element, the identifier of at least one of the plurality of second elements, and the target configuration information configured in the tracking information configuration page to the server, so that the server generates a tracking configuration file corresponding to the page to be analyzed based on the identifier of the first element, the identifier of the at least one second element, and the target configuration information. The tracking configuration file is used to collect tracking data on the page to be analyzed.
[0101] In one example, after the first client determines the plurality of second elements, it can display the plurality of second elements and allow the user to select at least one second element from the plurality of second elements that actually needs to be tracked, thereby satisfying the user's personalized tracking needs.
[0102] As mentioned earlier, the event tracking information configuration page can display at least one page element from the page to be analyzed. In one example, the first client displays the plurality of elements. In a specific implementation, the plurality of second elements can be displayed in a specific style, wherein the specific style is different from the display style of other page elements among the at least one page element. For example, a selection indicator (e.g., a box) is displayed around the plurality of second elements. Accordingly, the user can select the at least one second element from the plurality of second elements displayed in the specific style.
[0103] In yet another example, the first client can present at least one combination of the same-type elements in a drop-down menu, wherein each combination can include at least one second element. In one specific example, the user can trigger a first operation (e.g., a click operation) at the same-type element input area, and the first client can present at least one combination of the same-type elements (e.g., present the name of at least one combination of the same-type elements) in a drop-down menu in response to the first operation. The user can trigger a second operation (e.g., a hover operation or a click operation) for a first combination of the same-type elements in the at least one combination of the same-type elements, and the first client can present the second elements included in the first combination of the same-type elements in a specific style so as to facilitate the user to determine which second elements are included in the first combination of the same-type elements. Accordingly, the user can select one or more combinations from the drop-down menu, and thus select the at least one second element.
[0104] It is to be noted that the first combination of the same-type elements can include one or more second elements. If the second elements are determined by S1021-S1022 mentioned below, the second elements in the first combination of the same-type elements can be determined according to the second position information corresponding to a certain level. If the second elements are determined by S1023-S1025 mentioned below, the second elements in the first combination of the same-type elements can be determined according to the to-be-selected CSS Selector determined in a certain iteration.
[0105] After the first client determines the at least one second element, the first client can obtain the identifier of the second element. The identifier of the second element can refer to the description of the identifier of the first element above, and thus will not be described herein.
[0106] In the embodiments of the present application, in addition to selecting the first element in the configuration page of the burying point information, the user can also input other configuration information in the configuration page of the burying point information. In one example, the user can also input target configuration information in the configuration page of the burying point information. The target configuration information is other configuration information used for the burying point data collection of the to-be-analyzed page, and accordingly, the first client can obtain the target configuration information.
[0107] As an example, the target configuration information can include one or more of the following: an event type corresponding to the burying point data collection, a trigger condition of the burying point data collection, and an attribute value corresponding to the burying point element.
[0108] The event type can include any event type occurring in a web page, for example, the event type can include a click event, an exposure event, a browsing event, and the like.
[0109] The trigger condition can be a condition required to be met for performing the collection of the buried point data. For example, the trigger condition can include: collecting data corresponding to a specific uniform resource locator (URL); or for example, the trigger condition can include: collecting the buried point data corresponding to a specific URL only when a stay time exceeds a preset time threshold, and the like, which are not listed one by one here.
[0110] The attribute value corresponding to the buried point element can be determined according to an actual business scenario. In a specific example, the attribute value corresponding to the buried point element can include text corresponding to the buried point element, a preset system variable, and business information. The preset system variable is not specifically limited by the embodiments of the present application, and includes but is not limited to one or more of a timestamp, a text title, and a page URL. The business information can be obtained through a business interface. For example, a business request sent or received through the business interface can be obtained, and the business information is determined according to data such as a request method, a URL, a request body, and a response body included in the business request.
[0111] After the first client obtains the identifier of the first element, the identifier of the at least one second element, and the target configuration information, the first client can send the identifier of the first element, the identifier of the at least one second element, and the target configuration information to a server. After the server receives the identifier of the first element, the identifier of the at least one second element, and the target configuration information sent by the first client, the server can generate a buried point configuration file corresponding to the page to be analyzed according to the identifier of the first element, the identifier of the at least one second element, and the target configuration information, and the buried point configuration file is used for collecting buried point data of the page to be analyzed. In an example, the server can generate a buried point configuration file in a specific format according to the identifier of the first element, the identifier of the at least one second element, and the target configuration information, and the buried point configuration file includes the identifier of the first element, the identifier of the at least one second element, and the target configuration information.
[0112] In an example, after the server generates the buried point configuration file, the server can send the buried point configuration file to a second client, so that the second client collects buried point data of the page to be analyzed by using the buried point configuration file.
[0113] It can be learned from the above description that, by using the scheme, the user does not need to write corresponding software code, but can perform corresponding configuration in the visualized burying point information configuration page, and for the same type of elements, the user only needs to select one element (the first element) in the burying point information configuration page, thereby effectively reducing the research and development and operation and maintenance cost of performing burying point analysis on the page to be analyzed.
[0114] Next, the method for determining the second element will be described in combination with Figures 3 to 6 Two implementation manners of S102 will be introduced.
[0115] Referring to Figure 3 The figure is a flowchart of a method for determining a second element provided by an embodiment of the application. Figure 3 The method shown may, for example, include the following S1021-S1022.
[0116] S1021: replace the first number in the first position information with a preset path wildcard to obtain second position information, the preset path wildcard indicating that the first number is ignored.
[0117] As described above, the element path of the first element includes N levels, and therefore, the first position information includes N numbers, and the first number may be one of the N numbers.
[0118] In one example, one number may be randomly selected from the N numbers as the first number.
[0119] In yet another example, in order to determine as many same type of elements of the first element as possible, the numbers corresponding to each level in the N levels in the first position information may be replaced with a preset path wildcard in a preset order to obtain the second position information corresponding to each level. The preset order is not specifically limited in the application, and may be an order from a low level to a high level, or an order from a high level to a low level.
[0120] In the embodiment of the application, the preset path wildcard is used to indicate that the first number is ignored, and in one example, the preset wildcard may be a character “*”.
[0121] S1022: determine the second elements according to the second position information and the path level.
[0122] After determining the second location information and the path hierarchy, the plurality of second elements can be determined based on the second location information and the path hierarchy. Specifically, the elements in the page to be analyzed can be traversed, and elements whose element path is the same as that of the first element and whose location information is the second location information can be determined as second elements.
[0123] Regarding S1021-S1022, now combined with Figure 4 Let's illustrate with examples.
[0124] like Figure 4 As shown, Figure 4 This is a schematic diagram of the DOM structure of a page to be analyzed, provided in an embodiment of this application. The first element corresponds to node 401, and the path information of the first element is: / body / ... / tbody / tr / td / div / span, and the first position information is ['0',...,'0','1','3','0','0']. Then, following the order from low level to high level, the second position information corresponding to each level is obtained sequentially, such as... Figure 4 As shown, second location information 410, 420, 430, 440, 450 and 460 can be obtained, and at least one second element can be obtained based on the location information corresponding to each level and the path information.
[0125] See Figure 5 The figure is a flowchart illustrating another method for determining a second element provided in an embodiment of this application. Figure 5 The method shown may include, for example, the following S1023-S1025.
[0126] S1023: Determine the candidate CSS Selector based on the first CSS Selector.
[0127] In one example, a CSS Selector that inherits from the first CSS Selector can be identified as a candidate CSS Selector. Here, a CSS Selector that inherits from the first CSS Selector refers to a CSS Selector that has a direct or indirect parent-child relationship with the first CSS Selector. For example, the first parent CSS Selector of the first CSS Selector can be identified as a candidate CSS Selector. Alternatively, the second parent CSS Selector of the first parent CSS Selector, or the third parent CSS Selector of the second parent CSS Selector, can be identified as a candidate CSS Selector.
[0128] In yet another example, in order to determine as many same-type elements of the first element as possible, M rounds of iteration can be performed to determine the candidate CSS Selector corresponding to each round of iteration respectively. M is an integer greater than 1. Wherein:
[0129] In the first round of iteration, the parent CSS Selector of the first CSS Selector can be determined as the candidate CSS Selector corresponding to the first round of iteration.
[0130] In the i-th round of iteration, the candidate CSS Selector corresponding to the i-th round of iteration can be determined according to the candidate CSS Selector determined in the (i-1)-th round of iteration. In one example, the CSS Selector having an inheritance relationship with the candidate CSS Selector corresponding to the (i-1)-th round of iteration can be determined as the candidate CSS Selector corresponding to the i-th round of iteration. Wherein, i is an integer greater than 1 and less than or equal to M.
[0131] S1024: Determine the relative CSS Selector between the first CSS Selector and the candidate CSS Selector.
[0132] After determining the candidate CSS Selector, the relative path calculation can be performed according to the first CSS Selector and the candidate CSS Selector to obtain the relative CSS Selector, wherein the relative CSS Selector can also be referred to as a relative fragment Selector.
[0133] S1025: Determine the second element according to the candidate CSS Selector and the relative CSS Selector.
[0134] After determining the relative CSS Selector, at least one second CSS Selector having a relative path between the candidate CSS Selector and the relative CSS Selector as the relative CSS Selector can be determined according to the candidate CSS Selector and the relative CSS Selector, and the element corresponding to the at least one second CSS Selector can be determined as a second element, thereby obtaining the second element.
[0135] Regarding S1023-S1025, examples will be illustrated in combination with Figure 6 Figure 6 This also illustrates a schematic diagram of the DOM structure of a page to be analyzed.
[0136] like Figure 6 As shown, the first element is the corresponding Figure 6 As shown in node 601, in the first iteration, the parent CSS Selector of the first CSS Selector is determined as the candidate CSS Selector. Correspondingly, the second element is determined based on the candidate CSS Selector corresponding to the first iteration. Here, the parent CSS Selector of the first CSS Selector corresponds to... Figure 6 Node 610 is shown.
[0137] In the second iteration, based on the CSS Selector of node 610, the CSS Selector corresponding to node 620 is determined as the candidate CSS Selector. Accordingly, the second element is determined based on the candidate CSS Selector corresponding to the second iteration.
[0138] Next, we will introduce the specific implementation method of collecting event tracking data from the page to be analyzed on the second server side. See [link / reference] Figure 7 The figure is a flowchart illustrating a method for embedding data points according to an embodiment of this application. Figure 7 The method shown can be applied to a second client. In one example, the method may include, for instance, the following steps S201-S203.
[0139] S201: Receive the event tracking configuration file sent by the server.
[0140] Regarding the aforementioned event tracking configuration file, please refer to the relevant description section above; it will not be repeated here.
[0141] S202: Obtain the target event in the page to be analyzed, and match the target event with the event tracking configuration file.
[0142] S203: If the target event successfully matches the data point configuration file, collect the data point data corresponding to the target event.
[0143] In one example, the second client can acquire events occurred in the page to be analyzed by using a corresponding event acquisition instance. After acquiring a target event in the page to be analyzed, the target event can be matched with the trace configuration file. In one example, the second client can traverse configuration information in the trace configuration file one by one, and match the configuration information with the target event. As an example, an event type corresponding to trace data collection in the configuration information is matched with the target event. If the event type included in the configuration information includes the event type of the target event, it can be further determined whether a trigger condition included in the configuration information is met, and in the case that the trigger condition is met, it can be determined that the target event is successfully matched with the trace configuration file. Otherwise, it can be determined that the target event fails to match with the trace configuration file.
[0144] After it is determined that the target event is successfully matched with the trace configuration file, trace data corresponding to the target event can be further collected. In one example, the trace data to be collected can be determined according to an attribute value of a trace element corresponding to the target event in the trace configuration file, and the trace data can be further collected.
[0145] In one example, after the second client collects the trace data, the trace data can be reported to other data processing ends, and the data processing ends can process the trace data. The data processing ends mentioned herein can be a data warehouse for storing data, or a server for analyzing data, and the present application does not make specific limitations.
[0146] Next, taking an exposure event as an example, the specific implementation manner of S202-S203 is introduced.
[0147] The second client traverses trace information in the trace configuration file by using the first callback function, and the trace information includes an identifier of the first element, and parses a DOM instance corresponding to the first element. It is determined according to the second callback function whether the DOM instance corresponding to the first element is exposed. If the DOM instance corresponding to the first element has been exposed, it is further determined whether other trigger conditions corresponding to the first element are met, for example, whether one or more factors such as a URL, an exposure frequency, an exposure time length, and an exposure proportion are met. In the case that the other trigger conditions are met, data corresponding to the first element is collected according to an attribute value of the first element, and the data is reported to a data processing end.
[0148] Exemplary device
[0149] Based on the method provided in the above embodiments, the present application further provides an apparatus, which is introduced below in combination with the drawings.
[0150] Referring to Figure 8 FIG. 1 is a structural schematic diagram of a device for processing a buried point according to an embodiment of the present application. Figure 8 The device 800 shown includes a first acquisition unit 801, a determination unit 802, and a sending unit 803.
[0151] The first acquisition unit 801 is configured to, in response to a selection operation triggered in a buried point information configuration page for a first element, acquire an identifier of the first element, the first element being an element in a page to be analyzed.
[0152] The determination unit 802 is configured to determine, according to the identifier of the first element, a plurality of second elements in the page to be analyzed, the second elements being homogenous elements of the first element.
[0153] The sending unit 803 is configured to send the identifier of the first element, an identifier of at least one second element of the plurality of second elements, and target configuration information configured in the buried point information configuration page to a server, so that the server generates a buried point configuration file corresponding to the page to be analyzed based on the identifier of the first element, the identifier of the at least one second element, and the target configuration information, the buried point configuration file being used for collecting buried point data of the page to be analyzed.
[0154] Optionally, the identifier of the first element includes a path position of the first element, the path position including path information and first position information, the path information indicating that an element path of the first element includes N levels, N being an integer greater than 1, and the first position information indicating that a label name of the first element respectively corresponds to a number at each of the levels, wherein the N levels include a first level, the first level including at least one element having the label name, the number of the label name of the first element at the first level indicating a number of the first element in the at least one element having the label name, and the determination unit 802 is configured to:
[0155] replace a first number in the first position information with a preset path wildcard to obtain second position information, the preset path wildcard indicating that the first number is ignored.
[0156] determine the plurality of second elements according to the second position information and the path information.
[0157] Optionally, the replacing the first number in the first position information with the preset path wildcard to obtain the second position information includes:
[0158] According to a preset order, the numbers corresponding to each of the N levels in the first location information are replaced with preset path wildcards to obtain the second location information corresponding to each level. The numbers corresponding to each level in the first location information include the first number.
[0159] Optionally, the identifier of the first element includes the first cascading style sheet selector of the first element, and the determining unit 802 is used to:
[0160] Based on the first cascading style sheet selector, determine the cascading style sheet selector to be selected;
[0161] Determine the relative cascading style sheet path between the first cascading style sheet selector and the candidate cascading style sheet selector;
[0162] The plurality of second elements are determined based on the candidate cascading style sheet selector and the relative cascading style sheet selector.
[0163] Optionally, determining the candidate Cascading Style Sheet selector based on the first Cascading Style Sheet selector includes:
[0164] The candidate cascading style sheet selectors are determined through M iterations, where M is an integer greater than 1; where:
[0165] In the first iteration, the first parent cascading style sheet selector of the first cascading style sheet selector is determined as the candidate cascading style sheet selector corresponding to the first iteration.
[0166] In the i-th iteration, the cascading style sheet selector that has an inheritance relationship with the candidate cascading style sheet selector determined in the (i-1)-th iteration is determined as the candidate cascading style sheet selector corresponding to the i-th iteration, where i is an integer greater than 1 and less than or equal to M.
[0167] Optionally, the determining unit 802 is used for:
[0168] In response to the automatic acquisition operation of similar elements triggered in the event tracking information configuration page, several second elements in the page to be analyzed are determined based on the identifier of the first element.
[0169] Optionally, the device further includes:
[0170] A display unit is used to display the plurality of second elements;
[0171] The second acquisition unit is configured to acquire the identifier of the at least one second element in response to a selection operation triggered for at least one second element among the plurality of elements.
[0172] Optionally, the target configuration information comprises one or more of the following:
[0173] The event type corresponding to the embedded point data collection, the trigger condition of the embedded point data collection, and the attribute value corresponding to the embedded point element, the embedded point element comprising the first element and the at least one second element.
[0174] Since the apparatus 800 is the apparatus corresponding to the embedded point processing method performed by the first client provided in the above method embodiments, the specific implementation of each unit of the apparatus 800 is the same as the same concept as the above method embodiments, and therefore, the specific implementation of each unit of the apparatus 800 can be referred to the related description part of the above method embodiments, which will not be described here again.
[0175] Referring to Figure 9 , the figure is a structure schematic diagram of another embedded point processing apparatus provided in the embodiments of the present application. The apparatus 900 comprises a receiving unit 901, an obtaining unit 902, and a collecting unit 903.
[0176] The receiving unit 901 is configured to receive the embedded point configuration file sent by the server, wherein the embedded point configuration file is the embedded point configuration file in the above method embodiments;
[0177] The obtaining unit 902 is configured to obtain the target event in the page to be analyzed, and match the target event with the embedded point configuration file;
[0178] The collecting unit 903 is configured to collect the embedded point data corresponding to the target event in the case that the target event is successfully matched with the embedded point configuration file.
[0179] Since the apparatus 900 is the apparatus corresponding to the embedded point processing method performed by the second client provided in the above method embodiments, the specific implementation of each unit of the apparatus 900 is the same as the same concept as the above method embodiments, and therefore, the specific implementation of each unit of the apparatus 900 can be referred to the related description part of the above method embodiments, which will not be described here again.
[0180] The embodiments of the present application further provide an embedded point processing device, wherein the embedded point processing device comprises a processor and a memory;
[0181] The processor is configured to execute the instructions stored in the memory, so that the device executes the embedded point processing method provided in the above method embodiments. For example, the device can be caused to execute the embedded point processing method performed by the first client provided in the above method embodiments; for another example, the device can be caused to execute the embedded point processing method performed by the second client provided in the above method embodiments.
[0182] The embodiment of the present application provides a computer readable storage medium, comprising instructions, which instruct a device to perform the method for processing a burying point provided in the above method embodiment. For example, the instructions instruct the device to perform the method for processing a burying point executed by the first client provided in the above method embodiment; or for example, the instructions instruct the device to perform the method for processing a burying point executed by the second client provided in the above method embodiment.
[0183] The embodiment of the present application also provides a computer program product, which, when running on a computer, causes the computer to perform the method for processing a burying point provided in the above method embodiment. For example, the computer program product causes the computer to perform the method for processing a burying point executed by the first client provided in the above method embodiment; or for example, the computer program product causes the computer to perform the method for processing a burying point executed by the second client provided in the above method embodiment.
[0184] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The specification and examples given are exemplary only and the true scope and spirit of the application are indicated by the following claims. It will be appreciated by persons skilled in the art that numerous variations and / or modifications can be made to the application as described above without departing from the scope or spirit of the application. It is intended that all such variations and / or modifications be included within the scope of the application. The specification and examples given are exemplary only and the true scope and spirit of the application are indicated by the following claims.
[0185] It should be understood that the application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application is limited only by the appended claims.
[0186] The above description is merely illustrative of the application, and not in limitation of the same. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the application, shall be included in the scope of protection of the application.
Claims
1. A method for processing embedded points, characterized in that, The method includes: In response to a selection operation triggered on the event tracking information configuration page for the first element, the identifier of the first element is obtained, where the first element is an element in the page to be analyzed. Based on the identifier of the first element, a plurality of second elements in the page to be analyzed are determined, wherein the second elements are elements of the same type as the first element; The identifier of the first element, the identifier of at least one of the plurality of second elements, and the target configuration information configured in the tracking information configuration page are sent to the server so that the server generates a tracking configuration file corresponding to the page to be analyzed based on the identifier of the first element, the identifier of at least one second element, and the target configuration information. The tracking configuration file is used to collect tracking data on the page to be analyzed. The target configuration information includes one or more of the following: the event type corresponding to the tracking data collection, the triggering condition for the tracking data collection, and the attribute value corresponding to the tracking element. The tracking element includes the first element and the at least one second element. The method is applied to a client, where the tracking information configuration page is displayed, and the first element of the page to be analyzed is displayed on the tracking information configuration page.
2. The method according to claim 1, characterized in that, The identifier of the first element includes the path position of the first element, the path position includes path information and first position information, the path information indicates that the element path of the first element includes N levels, where N is an integer greater than 1, and the first position information indicates the number corresponding to the tag name of the first element under each level, wherein the N levels include a first level, the first level includes at least one element with the tag name, and the number corresponding to the tag name of the first element under the first level indicates the number of the first element among the at least one element with the tag name. Determining several second elements in the page to be analyzed based on the identifier of the first element includes: The first number in the first location information is replaced with a preset path wildcard to obtain the second location information, wherein the preset path wildcard indicates that the first number is ignored; Based on the second location information and the path information, the plurality of second elements are determined.
3. The method according to claim 2, characterized in that, The step of replacing the first number in the first location information with a preset path wildcard to obtain the second location information includes: According to a preset order, the numbers corresponding to each of the N levels in the first location information are replaced with preset path wildcards to obtain the second location information corresponding to each level. The numbers corresponding to each level in the first location information include the first number.
4. The method according to claim 1, characterized in that, The identifier of the first element includes the first cascading style sheet selector of the first element. The step of determining several second elements in the page to be analyzed based on the identifier of the first element includes: Based on the first cascading style sheet selector, determine the cascading style sheet selector to be selected; Determine the relative cascading style sheet path between the first cascading style sheet selector and the candidate cascading style sheet selector; The plurality of second elements are determined based on the candidate cascading style sheet selector and the relative cascading style sheet selector.
5. The method according to claim 4, characterized in that, The step of determining the candidate cascading style sheet selector based on the first cascading style sheet selector includes: The candidate cascading style sheet selectors are determined through M iterations, where M is an integer greater than 1; where: In the first iteration, the first parent cascading style sheet selector of the first cascading style sheet selector is determined as the candidate cascading style sheet selector corresponding to the first iteration. In the i-th iteration, the cascading style sheet selector that has an inheritance relationship with the candidate cascading style sheet selector determined in the (i-1)-th iteration is determined as the candidate cascading style sheet selector corresponding to the i-th iteration, where i is an integer greater than 1 and less than or equal to M.
6. The method according to claim 1, characterized in that, The step of obtaining several second elements from the page to be analyzed based on the identifier of the first element includes: In response to the automatic acquisition operation of similar elements triggered in the event tracking information configuration page, several second elements in the page to be analyzed are determined based on the identifier of the first element.
7. The method according to claim 1, characterized in that, The method further includes: Show the aforementioned several second elements; In response to a selection operation triggered for at least one second element among the plurality of elements, the identifier of the at least one second element is obtained.
8. A method for processing embedded points, characterized in that, The method includes: The system receives a data entry configuration file sent by the server, wherein the data entry configuration file is the data entry configuration file described in any one of claims 1-7. Obtain the target event from the page to be analyzed, and match the target event with the event tracking configuration file; If the target event matches the event tracking configuration file, the tracking data corresponding to the target event is collected.
9. A device for processing buried points, characterized in that, The device includes: The first acquisition unit is used to respond to the selection operation triggered for the first element in the tracking information configuration page, and to acquire the identifier of the first element, wherein the first element is an element in the page to be analyzed. The determining unit is used to determine a plurality of second elements in the page to be analyzed based on the identifier of the first element, wherein the second elements are elements of the same type as the first element; The sending unit is configured to send the identifier of the first element, the identifier of at least one of the plurality of second elements, and the target configuration information configured in the tracking information configuration page to the server, so that the server generates a tracking configuration file corresponding to the page to be analyzed based on the identifier of the first element, the identifier of the at least one second element, and the target configuration information. The tracking configuration file is used to collect tracking data on the page to be analyzed. The target configuration information includes one or more of the following: the event type corresponding to the tracking data collection, the triggering condition for the tracking data collection, and the attribute value corresponding to the tracking element. The tracking element includes the first element and the at least one second element. The device runs a client application, which displays the tracking information configuration page and the first element of the page to be analyzed.
10. A device for processing embedded points, characterized in that, The device includes: A receiving unit is configured to receive a data tracking configuration file sent by the server, wherein the data tracking configuration file is the data tracking configuration file described in any one of claims 1-7. The acquisition unit is used to acquire the target event in the page to be analyzed and match the target event with the event tracking configuration file. The acquisition unit is used to acquire the tracking data corresponding to the target event when the target event is successfully matched with the tracking configuration file.
11. A device for processing buried points, characterized in that, The device includes a processor and a memory; The processor is configured to execute instructions stored in the memory to cause the device to perform the method as described in any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that, Includes instructions that instruct the device to perform the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method and system for acquiring interactive data
CN110059282A
Application burying point method, device, computing equipment and system
CN110196953A
Method and system for constructing industrial product application system based on front-end technology
CN115469840A