Component generation method and device for event tracking plug-in, medium and product
By building monitoring description information and refactoring components to generate event tracking plugins, the compatibility and rapid iteration issues in existing technologies are resolved, enabling fast and efficient data collection and privacy protection, suitable for various data collection needs.
Patent Information
- Application Number
- CN202511101797.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-11-21
AI Technical Summary
Existing front-end statistical tracking solutions cannot effectively meet the needs of compatibility, rapid iteration, and quick integration of tracking points in small projects, resulting in the inability to quickly and efficiently generate event tracking plugins suitable for various data collection needs.
By constructing monitoring description information, obtaining the corresponding target monitoring components, reconstructing and splicing the components, generating an event tracking plugin that matches the target front-end page, and adding the plugin to the project file, the system can support accurate adaptation of user browsing data and privacy protection.
It enables the rapid and efficient generation of event tracking plugins suitable for various data collection scenarios, lowers the technical threshold for developers, can cope with the high-speed iteration of front-end pages, and ensures user privacy protection.
Smart Images

Figure CN120994493A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a componentized generation method, device, medium and product of an event tracking plug-in. BACKGROUND
[0002] With the continuous development of mobile Internet technology, the development, online and iteration timeline of the front-end Web page is also continuously shortened. Generally speaking, after a new front-end page project is put online, user behavior and usage statistics are an important task, and detailed and practical analysis data can enable developers to better optimize the project and specify the later development plan.
[0003] At present, event tracking (which can also be referred to as front-end statistical burying) technology is mainly used for user behavior and usage data collection. The existing front-end statistical burying scheme is mainly divided into three categories, code burying, dynamic burying and full burying.
[0004] The inventors found in the process of implementing the present application that the existing three front-end statistical burying schemes cannot guarantee compatibility when targeting different projects, cannot support rapid iteration and rapid output of various monitoring type modules, and in addition, the rapid access requirements of small engineering burying cannot be effectively met. SUMMARY
[0005] The embodiment of the present application provides a componentized generation method, device, medium and product of an event tracking plug-in, to provide a componentized event tracking plug-in generation scheme, and to realize rapid and efficient generation of event tracking plug-ins suitable for various data collection demand scenarios.
[0006] According to an aspect of the embodiment of the present application, a componentized generation method of an event tracking plug-in is provided, comprising:
[0007] In response to the monitoring demand information matching the target front-end page issued by the demand side, at least one piece of monitoring description information is constructed, and the monitoring description information includes the set index value that needs to be monitored under the set monitoring index;
[0008] In the pre-constructed monitoring components, the target monitoring components corresponding to each monitoring description information are obtained, wherein the monitoring components are realized through the programming code constructed based on the listener;
[0009] If the target monitoring component for monitoring the user browsing data is identified in the target monitoring components, the identified target monitoring component is reconstructed using the matching monitoring description information;
[0010] The target monitoring components are spliced according to a preset component splicing mode to obtain an event tracking plug-in matched with the target front-end page, and the event tracking plug-in is added to an engineering file matched with the target front-end page.
[0011] According to another aspect of the embodiment of the present application, an apparatus for componentized generation of an event tracking plug-in is provided, comprising:
[0012] A monitoring description information construction module is configured to construct at least one piece of monitoring description information in response to monitoring demand information issued by a demand side and matched with a target front-end page, wherein the monitoring description information comprises a set index value to be monitored under a set monitoring index;
[0013] A target monitoring component acquisition module is configured to acquire target monitoring components corresponding to each piece of monitoring description information from each monitoring component constructed in advance, wherein the monitoring component is implemented through programming code constructed based on a listener;
[0014] A component reconstruction module is configured to reconstruct a target monitoring component identified in the target monitoring components if the target monitoring component is of a monitoring index of user browsing data, using matched monitoring description information;
[0015] An event tracking plug-in generation module is configured to splice the target monitoring components according to a preset component splicing mode to obtain an event tracking plug-in matched with the target front-end page, and add the event tracking plug-in to an engineering file matched with the target front-end page.
[0016] According to another aspect of the embodiment of the present application, an electronic device is provided, comprising:
[0017] at least one processor; and
[0018] a memory in communication connection with the at least one processor; wherein
[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the componentized generation method of the event tracking plug-in according to any one of the embodiments of the present application.
[0020] According to another aspect of the embodiment of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to execute the componentized generation method of the event tracking plug-in according to any one of the embodiments of the present application.
[0021] According to another aspect of the embodiments of the present application, there is also provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of the componentized generation method of the event tracking plug-in as described in any of the embodiments of the present application.
[0022] The technical solution of the embodiments of the present application provides a new type of componentized event tracking plug-in generation scheme by constructing at least one piece of monitoring description information in response to the monitoring demand information issued by the demand side and matching the target front-end page, obtaining the target monitoring component corresponding to each piece of monitoring description information in the pre-constructed monitoring components, reconstructing the identified target monitoring component using the matched monitoring description information if the target monitoring component with the monitoring index of user browsing data is identified in the target monitoring components, splicing the target monitoring components according to the pre-set component splicing mode to obtain the event tracking plug-in matching the target front-end page, and adding the event tracking plug-in to the engineering file matching the target front-end page, which can quickly and efficiently generate the event tracking plug-in suitable for various data collection demand scenarios, has a simple implementation manner, has a low technical threshold requirement for the developers, and can effectively cope with the high-speed iteration scenario of the front-end page.
[0023] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0025] Figure 1 is a flowchart of a componentized generation method of an event tracking plug-in according to an embodiment of the present application;
[0026] Figure 2 is a flowchart of another componentized generation method of an event tracking plug-in according to an embodiment of the present application;
[0027] Figure 3 is a structural schematic diagram of a componentized generation device of an event tracking plug-in according to an embodiment of the present application;
[0028] Figure 4 is a structural schematic diagram of an electronic device implementing the componentized generation method of the event tracking plug-in according to an embodiment of the present application. DETAILED DESCRIPTION
[0029] 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 combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by the person skilled in the art without creative labor should belong to the protection scope of the present application.
[0030] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0031] Figure 1 A flowchart of a componentized generation method of an event tracking plug-in provided by the embodiments of the present application, the embodiments can be applicable to the case that the componentized event tracking plug-in is constructed according to the data monitoring demand of the demand side for the front-end page to be online, and the method can be executed by a componentized generation device of the event tracking plug-in. The device can be realized in the form of hardware and / or software, and can generally be configured in an electronic device with data processing function. For example, a terminal device such as a mobile phone, a tablet computer or a desktop computer, which is executed by the componentized generation software of the event tracking plug-in installed in the electronic device.
[0032] Correspondingly, as shown in Figure 1 the method can include:
[0033] S110, in response to the monitoring demand information issued by the demand side and matched with the target front-end page, at least one piece of monitoring description information is constructed.
[0034] The target front-end page can be understood as a software product to be used online, which provides services to users in the form of single-page application. Generally, the developer can develop the target front-end page in the form of engineering file in the set software engineering development tool, and the target front-end page is generally in the form of Web page.
[0035] As described above, when the target front-end page is developed and put into operation, the service provider of the target front-end page often wants to dynamically grasp the actual operation of the target front-end page by the user and the actual running performance of the target front-end page. Therefore, it is often necessary to perform data burying in the target front-end page to obtain various monitoring data required for event tracking.
[0036] Correspondingly, the demand side can be understood as the service provider of the target front-end page, and the monitoring demand information can be understood as the description information of various monitoring data required for event tracking during the actual online running of the target front-end page.
[0037] In this embodiment, by means of semantic analysis, one or more monitoring description information can be parsed and constructed in the monitoring demand information matched with the target front-end page. The monitoring description information includes the set index value required to be monitored under the set monitoring index.
[0038] Further, the monitoring index can be understood as the monitoring data type to which various monitoring data required for event tracking belongs, and the index value can be understood as the data subclass that needs to be monitored under the set monitoring index category.
[0039] For example, the monitoring index can include performance data, user browsing data, and abnormal data, etc. The performance data can be understood as data describing the actual running performance of the target front-end page, the user browsing data can be understood as various behaviors or interaction data generated by the user when actually accessing the target front-end page, and the abnormal data can be understood as various error or abnormal data occurring in the actual running process of the target front-end page.
[0040] Further, the index value matched with the performance data can include the first screen loading speed and white screen time when the target front-end page is loaded by various types of terminals, the http request response time and the overall static resource download time when the target front-end page runs on different types of terminals, etc. The index value matched with the user browsing data can include the page view and click volume of the target front-end page by the user, the number of users accessing specific information items in the target front-end page from different IP addresses, the residence time of the user in each sub-page of the target front-end page, the entry through which the user accesses the target front-end page, and the type of user behavior triggered by the user in the target front-end page, etc. The index value matched with the abnormal data can include resource abnormality, js abnormality, and style loss abnormality, etc.
[0041] In the embodiment, when the componentized event tracking plug-in generation software is started, the componentized construction process of the event tracking plug-in can be automatically or semi-automatically implemented in the software. First, the developer can import the monitoring requirement information matching the target front-end page issued by the requirement party into the event tracking plug-in generation software, and the software automatically generates one or more monitoring description information.
[0042] In S120, the target monitoring component corresponding to each monitoring description information is obtained from the pre-constructed monitoring components.
[0043] In the embodiment, a plurality of pre-constructed monitoring plug-ins can be pre-installed in the event tracking plug-in generation software, and each monitoring plug-in is used to implement event tracking and data collection of the set indicator value in the set monitoring indicator in the target front-end page. The monitoring component is implemented by programming code based on the listener.
[0044] The listener (also referred to as Listener) can be understood as a program module for capturing and recording user behavior and system events, and its core function is to execute data collection logic when a specific trigger condition is met. By improving the implementation logic of the listener, a monitoring component meeting various event tracking functions can be constructed. Optionally, various monitoring components with high usage frequency can be pre-constructed according to the current mainstream event tracking requirements for direct calling. Correspondingly, the target monitoring component corresponding to each monitoring description information can be uniquely determined according to the monitoring indicator and the indicator value contained in each monitoring description information.
[0045] In an ideal case, the target monitoring component corresponding to each monitoring description information can be obtained. However, when the data to be collected by the requirement party is special or rare, the target monitoring component matching the monitoring description information can not be pre-constructed. At this time, the developer can be introduced to manually or semi-manually construct the target monitoring component matching the monitoring description information in the event tracking plug-in generation software.
[0046] In S130, if the target monitoring component in which the monitoring indicator is the user browsing data is identified, the identified target monitoring component is reconstructed using the matching monitoring description information.
[0047] The inventors find through actual research that when the monitoring index is performance data or abnormal data, the target monitoring component constructed by standardization does not need to be adjusted and can be directly added to the target front-end page for use. When the monitoring index is user browsing data, because the user behavior data to be monitored is often embodied through different page controls on different front-end pages, when the target monitoring component with the monitoring index of user browsing data is identified, adaptive reconstruction of the target monitoring component is often needed to make it meet the monitoring requirements of the matching target front-end page.
[0048] Correspondingly, in an optional implementation of the embodiment, if a target monitoring component with the monitoring index of user browsing data is identified in the target monitoring components, the identified target monitoring component is reconstructed using the matching monitoring description information, which can include:
[0049] S1301, obtaining monitoring description information matching the target monitoring component with the monitoring index of user browsing data.
[0050] S1302, locating the identification information of at least one user click control in the target front-end page according to the obtained monitoring description information.
[0051] S1303, reconstructing the target monitoring component with the monitoring index of user browsing data according to the located identification information.
[0052] In a specific example, assuming that the obtained monitoring description information A is the browsing times of a target data item in user browsing data, the identification information (for example, point control XX) of the user click control used to trigger browsing of the target data item can be located in the target front-end page first. Then, the identification information "point control XX" of the located user click control is added in the blank filling area used to describe the target data item to be counted in the target monitoring component B matching the monitoring description information A, so that reconstruction of the target monitoring component B can be realized.
[0053] Through the above setting, the target monitoring component with the monitoring index of user browsing data can be accurately adapted to the actual target front-end page efficiently.
[0054] S140, after the target monitoring components are spliced according to the preset component splicing manner, an event tracking plug-in matching the target front-end page is obtained, and the event tracking plug-in is added to the engineering file matching the target front-end page.
[0055] In this embodiment, a splicing template can be pre-built, and the splicing positions of different types of monitoring components can be defined in the splicing template. After each target monitoring component is filled into the splicing template, an event tracking plugin that matches the target front-end page can be spliced together.
[0056] Furthermore, after the event tracking plugin is inserted into the project file matching the target front-end page in a non-intrusive manner, once the target front-end page is launched, it can collect and obtain various monitoring data required by the client in real time as users access the target front-end page through different terminal devices.
[0057] Generally, different target monitoring components are used to collect different types of monitoring data. Accordingly, the above target monitoring components can be spliced in parallel to enable parallel triggering and execution of each target monitoring component in the event tracking plugin, so that each target monitoring component can collect its own required monitoring data without interfering with each other.
[0058] In addition, it is important to emphasize that in order to protect users' privacy during web page access, an authorization page should be provided to users before using the event tracking plugin to collect user behavior data. The event tracking plugin will only be triggered and executed after the user authorizes it; otherwise, the event tracking plugin will not be executed to collect data.
[0059] Based on the above embodiments, the method may further include:
[0060] If the monitoring requirements are determined to include advanced privacy protection needs, then build a quick protection plugin;
[0061] Accordingly, in addition to adding the event tracking plugin to the project file that matches the target front-end page, it also includes:
[0062] Add the quick protection plugin to the project file that matches the target front-end page;
[0063] The quick protection plugin is used to block the event tracking plugin from continuing to track events on the target front-end page by disconnecting it through hardware, based on the event tracking authorization revocation command sent by the user in real time while the user is browsing the target front-end page.
[0064] In this optional implementation, if the monitoring requirement information includes advanced privacy protection requirements, a fast protection plugin can be adaptively matched to those advanced privacy protection requirements.
[0065] As mentioned above, the event tracking plug-in will not be executed when the user does not authorize the collection of user behavior data to the target front-end page. However, there is another case that the user initially opens the authorization of the event tracking plug-in, but withdraws the authorization during use, that is, sends an event tracking authorization withdrawal instruction to the target front-end page. At this time, the target front-end page will immediately end the execution of the event tracking plug-in and stop reporting the data collected by the event tracking plug-in in the software layer. This software disconnecting method has a slow response time and may complete the reporting of the collected data at the moment of disconnection.
[0066] Based on this, in order to protect user behavior data at a higher level and meet the real-time behavior data protection needs of users, a hardware disconnecting method is creatively introduced to block the event tracking plug-in from continuing to track the target front-end page. Specifically, the fast protection plug-in can forcibly disconnect the network connection by blocking the power supply to the network communication module, so as to timely block the continued reporting of the data collected by the event tracking plug-in.
[0067] On the basis of the above embodiments, the method can further include:
[0068] If it is determined that the monitoring requirement information further includes tracking result post-processing information, generating tracking result post-processing logic code according to the tracking result post-processing information;
[0069] Correspondingly, after adding the event tracking plug-in to the project file matched with the target front-end page, the method can further include:
[0070] Adding the tracking result post-processing logic code to the project file matched with the target front-end page.
[0071] In this embodiment, the demand side can further add tracking result post-processing information to the monitoring requirement information, wherein the tracking result post-processing information defines the specific post-processing information required for the data collected by the event tracking plug-in. For example, the tracking result post-processing information can include the server or database required for reporting the collected data, the data storage method of the collected data, and the data post-processing logic of the collected data, and the present embodiment does not limit this.
[0072] After obtaining the tracking result post-processing information, the tracking result post-processing logic code can be generated based on the tracking result post-processing information, and the tracking result post-processing logic code can be added to the project file matched with the target front-end page. Through the above setting, the post-processing logic of the data collected by the event tracking plug-in can be simplified, and the amount of manual participation can be maximally reduced.
[0073] The technical scheme of the embodiment of the application comprises the following steps: in response to monitoring demand information matching a target front-end page issued by a demand side, at least one piece of monitoring description information is constructed; in each monitoring component constructed in advance, a target monitoring component corresponding to each piece of monitoring description information is acquired; if a target monitoring component in which a monitoring index is user browsing data is identified in each target monitoring component, the identified target monitoring component is reconstructed using the matched monitoring description information; after each target monitoring component is spliced according to a preset component splicing mode, an event tracking plug-in matching the target front-end page is obtained, and the event tracking plug-in is added to an engineering file matching the target front-end page, thereby providing a novel componentized event tracking plug-in generation scheme, which can quickly and efficiently generate an event tracking plug-in suitable for various data collection demand scenarios, has a simple implementation manner, has a low technical threshold requirement for developers, and can effectively cope with a high-speed iteration scenario of a front-end page.
[0074] Figure 2 The flowchart of another componentized event tracking plug-in generation method provided by the embodiment of the application is optimized based on the above-mentioned embodiments. In this embodiment, the case where no monitoring component precisely matching the target monitoring description information is searched for in each monitoring component is further refined, that is, after the operation of acquiring the target monitoring component corresponding to each piece of monitoring description information in each monitoring component constructed in advance, the operation further comprises: if no monitoring component precisely matching the target monitoring description information is searched for, a plurality of candidate monitoring components satisfying a similarity condition with the target monitoring description information are acquired through fuzzy matching; component source codes corresponding to each candidate monitoring component are acquired, and each component source code is fused based on the target monitoring description information through a large language model to obtain fused source code; a code programming interface matching the programming type of the monitoring component is triggered to be opened, and the fused source code is displayed in the code programming interface for secondary programming by a developer; in response to a confirmation instruction generated by the developer after completing the secondary programming, a target monitoring component matching the target monitoring description information is generated according to the target source code currently displayed in the code programming interface.
[0075] Correspondingly, as shown in Figure 2 the method can comprise:
[0076] S210, in response to monitoring demand information matching a target front-end page issued by a demand side, at least one piece of monitoring description information is constructed.
[0077] In an optional implementation of the embodiment, the demand side can further define a dynamic event tracking logic in the monitoring demand information. In a dynamic event tracking logic, different environmental conditions are defined, and the unprovided monitoring logic is adopted to collect data or track events. For example, in a dynamic event tracking logic, it can be defined that when the real-time network speed is AA, monitoring logic 1 is adopted to collect the first screen loading time in user browsing data; when the real-time network speed is BB, monitoring logic 2 is adopted to collect the first screen loading time in user browsing data. Correspondingly, the monitoring description information can further include: set index values required to be monitored by the set monitoring logic under the set monitoring index. That is, in each dynamic event tracking logic, according to the number of branches of environmental conditions, a plurality of monitoring description information matched can be split.
[0078] The different environmental conditions can be different network environment conditions, different page access interfaces, or different terminal operating system environments, and the embodiment does not limit this.
[0079] S220, in the pre-constructed monitoring components, the target monitoring component corresponding to each monitoring description information is obtained.
[0080] In the embodiment, when the monitoring description information includes set index values required to be monitored by the set monitoring logic under the set monitoring index, the monitoring component can be specifically used to collect data of the set index value in the set type monitoring index on the front-end page by the set monitoring logic.
[0081] Further, two monitoring description information with the same monitoring index and index value but different monitoring logics can correspond to two different target monitoring components respectively.
[0082] S230, if the target monitoring component precisely matched with the target monitoring description information is not searched, a plurality of alternative monitoring components satisfying the similarity condition with the target monitoring description information are obtained by fuzzy matching.
[0083] As described above, if the target monitoring component matched with the target monitoring description information is not pre-constructed in the componentized event tracking plug-in generation software, the developer needs to be introduced to manually construct it. In the embodiment, the developer does not completely construct the target monitoring plug-in matched with the target monitoring description information from scratch, but can obtain the similar alternative monitoring plug-in constructed with the required monitoring component of the target monitoring description information, and provide it to the developer for secondary programming, so as to further reduce the development workload of the developer.
[0084] Specifically, in all monitoring components, multiple monitoring components with the same monitoring indicators and close indicator value semantics in the target monitoring description information can be obtained as alternative monitoring components.
[0085] In S240, component source codes corresponding to each alternative monitoring component are obtained, and each component source code is fused based on the target monitoring description information by using a large language model to obtain a fused source code.
[0086] In this embodiment, the target monitoring description information, the component source codes of each alternative monitoring component, and the monitoring indicators and indicator values corresponding to each alternative monitoring component are collectively provided to the large language model. According to the prior knowledge learned in advance, the large language model fuses each component source code to obtain a fused source code.
[0087] The large language model can be understood as a pre-trained large language model (LLM) based on a deep neural network architecture (for example, Transformer) with a large number of model parameters (for example, more than 1 billion). The large language model can be a generative AI system, that is, after being trained by a large amount of data, it can process multi-source input data such as text, images, or audio and video to achieve natural language understanding, generation, and reasoning to obtain new content. Typically, the large language model can be a self-attention language model that supports setting the context size.
[0088] In S250, a code programming interface matching the programming type of the monitoring component is triggered to be opened, and the fused source code is displayed in the code programming interface for secondary programming by the developer.
[0089] In an optional implementation of this embodiment, after triggering the code programming interface matching the programming type of the monitoring component to be opened, the following steps can be further included:
[0090] In S2501, a prompt word template is generated according to each basic calculation logic component constructed in advance, and the target monitoring description information and the prompt word template are input into the large language model.
[0091] The basic calculation logic component can be understood as a small functional component that implements a set of basic operation logic, such as addition, subtraction, average calculation, or variance calculation.
[0092] In the embodiment, a plurality of commonly used basic computing logic components can be pre-implemented in the generated software of the componentized event tracking plug-in, and each of the basic computing logic components is provided as a prompt word template together with the target monitoring description information to the large language model. Through the data reasoning capability of the large language model, the target basic computing logic component that is most likely to be used in the secondary programming process can be screened out from all the basic computing logic components and displayed.
[0093] Through the above setting, the developer can be provided with programming convenience, and will not be disturbed in programming due to excessive redundant display.
[0094] S2502, obtaining the target basic computing logic component screened out from the basic computing logic components by the large language model for the target monitoring description information.
[0095] S2503, displaying each target basic computing logic component in the code programming interface.
[0096] S260, in response to the confirmation instruction generated by the developer after completing the secondary programming, generating the target monitoring component matched with the target monitoring description information according to the target source code currently displayed in the code programming interface.
[0097] S270, if the target monitoring component in which the monitoring indicator is the user browsing data is identified in each target monitoring component, the identified target monitoring component is reconstructed using the matched monitoring description information.
[0098] S280, after splicing each target monitoring component according to the preset component splicing manner, obtaining the event tracking plug-in matched with the target front-end page, and adding the event tracking plug-in to the project file matched with the target front-end page.
[0099] On the basis of the above embodiments, since the monitoring description information further includes a set indicator value that needs to be monitored by using the set monitoring logic under the set monitoring indicator, and each target monitoring component is spliced according to the preset component splicing manner, specifically, the method can include the following steps.
[0100] S2801, identifying the first monitoring description information and the second monitoring description information from the monitoring description information according to the monitoring logic dynamic update information included in the monitoring requirement information.
[0101] In the embodiment, one monitoring logic dynamic update information is used to split two monitoring description information for splicing and description of the monitoring component.
[0102] Among them, the first monitoring description information and the second monitoring description information have the same monitoring indicator and indicator value, and have different monitoring logics.
[0103] S2802, extract the first environment condition matched with the first monitoring logic in the first monitoring description information and the second environment condition matched with the second monitoring logic in the second monitoring description information in the monitoring logic dynamic update information, and construct a component selection logic template according to the first environment condition and the second environment condition.
[0104] In the embodiment, a standardized two-branch component selection logic template can be constructed, and the first environment condition and the second environment condition are filled into the two-branch component selection logic template as two branch conditions, to obtain the component selection logic template.
[0105] S2803, fill the first target monitoring component matched with the first monitoring description information and the second target monitoring component matched with the second monitoring description information into the component selection logic template, to realize splicing of the first target monitoring component and the second target monitoring component.
[0106] Through the above setting, the two target monitoring components selected for execution according to the actual execution environment can be filled into the component selection logic template, to obtain a new combined monitoring component. Then, the combined monitoring component can be spliced in parallel with other target monitoring components to jointly constitute an event tracking plug-in matched with the target front-end page.
[0107] The technical scheme of the embodiment of the application can first obtain a plurality of alternative monitoring components with similar semantics in the constructed monitoring components when a developer needs to develop a new monitoring component through secondary programming, and provide the programming code of the above-mentioned alternative monitoring components to the developer after fusion through AI technology, so as to reduce human workload to the greatest extent. In addition, the way of constructing a combined monitoring component for dynamically selecting monitoring logic according to the actual running environment by introducing monitoring logic dynamic update information can further expand the applicable scenarios of the event tracking component constructed in a componentized manner, and meet the growing convenience and individualization of event tracking needs of people.
[0108] Figure 3 A structural schematic diagram of a componentized generation device of an event tracking plug-in provided by the embodiment of the application is shown in FIG. 1. Figure 3 As shown in the figure, the device comprises a monitoring description information construction module 310, a target monitoring component acquisition module 320, a component reconstruction module 330, and an event tracking plug-in generation module 340, wherein:
[0109] The monitoring description information construction module 310 is configured to construct at least one piece of monitoring description information in response to monitoring demand information matched with a target front-end page and issued by a demand side, and the monitoring description information comprises a set index value required to be monitored under a set monitoring index.
[0110] The target monitoring component acquisition module 320 is configured to acquire target monitoring components corresponding to the monitoring description information respectively from the pre-constructed monitoring components, wherein the monitoring components are implemented through programming codes constructed based on the listener;
[0111] The component reconstruction module 330 is configured to reconstruct the identified target monitoring component using the matched monitoring description information if the target monitoring component in which the monitoring index is the user browsing data is identified from the target monitoring components.
[0112] The event tracking plug-in generation module 340 is configured to splice the target monitoring components according to a preset component splicing manner to obtain an event tracking plug-in matched with the target front-end page, and add the event tracking plug-in into an engineering file matched with the target front-end page.
[0113] The technical scheme of the embodiment of the present application provides a new type of componentized event tracking plug-in generation scheme, can quickly and efficiently generate event tracking plug-ins suitable for various data collection demand scenarios, has a simple implementation manner, has a low technical threshold requirement for developers, can effectively cope with the high-speed iteration scenario of the front-end page, and has the advantages of the like.
[0114] On the basis of the above-mentioned embodiments, the new monitoring component generation module can be further included and configured to:
[0115] After the target monitoring components corresponding to the monitoring description information respectively are acquired from the pre-constructed monitoring components, if no monitoring component precisely matched with the target monitoring description information is searched, a plurality of candidate monitoring components satisfying a similarity condition with the target monitoring description information are acquired through a fuzzy matching manner.
[0116] The component source code corresponding to each candidate monitoring component is acquired, and each component source code is fused based on the target monitoring description information through a large language model to obtain fused source code.
[0117] A code programming interface matched with the programming type of the monitoring component is triggered to be started, and the fused source code is displayed in the code programming interface for secondary programming by the developer.
[0118] In response to the confirmation instruction generated by the developer after completing the secondary programming, the target monitoring component matching the target monitoring description information is generated according to the target source code currently displayed in the code programming interface.
[0119] On the basis of the above embodiments, the computing logic component screening display module can be further included, configured to:
[0120] After triggering the opening of the code programming interface matching the programming type of the monitoring component, the prompt word template is generated according to the pre-constructed basic computing logic components, and the target monitoring description information and the prompt word template are input into the large language model together;
[0121] The target basic computing logic component is screened out from the basic computing logic components by the large language model for the target monitoring description information;
[0122] The target basic computing logic components are displayed in the code programming interface.
[0123] On the basis of the above embodiments, the component reconstruction module 330 can be specifically configured to:
[0124] The monitoring description information matching the target monitoring component with the user browsing data as the monitoring index is obtained;
[0125] According to the obtained monitoring description information, the identification information of at least one user click control in the target front-end page is located;
[0126] According to the located identification information, the target monitoring component with the user browsing data as the monitoring index is reconstructed.
[0127] On the basis of the above embodiments, the monitoring description information can further include a set index value that needs to be monitored by the set monitoring logic under the set monitoring index;
[0128] Correspondingly, the event tracking plug-in generation module 340 can be further configured to:
[0129] According to the monitoring logic dynamic update information included in the monitoring requirement information, the first monitoring description information and the second monitoring description information are identified in the monitoring description information;
[0130] Among the first monitoring description information and the second monitoring description information, the same monitoring index and index value are included, and the different monitoring logics are included;
[0131] extracting a first environment condition matching the first monitoring logic in the first monitoring description information and a second environment condition matching the second monitoring logic in the second monitoring description information from the monitoring logic dynamic update information, and constructing a component selection logic template according to the first environment condition and the second environment condition;
[0132] filling the first target monitoring component matching the first monitoring description information and the second target monitoring component matching the second monitoring description information into the component selection logic template to realize splicing of the first target monitoring component and the second target monitoring component.
[0133] On the basis of the above-mentioned embodiments, the rapid protection plug-in construction module can be further included, which is configured to:
[0134] if it is determined that the high-level privacy protection requirement is included in the monitoring requirement information, constructing the rapid protection plug-in;
[0135] Correspondingly, the rapid protection plug-in adding module can be further included, which is configured to:
[0136] synchronously adding the rapid protection plug-in into the engineering file matching the target front-end page while adding the event tracking plug-in into the engineering file matching the target front-end page;
[0137] The rapid protection plug-in is configured to, in the process that the user browses the target front-end page, according to the event tracking authorization revocation instruction sent by the user in real time, block the event tracking plug-in from continuing to track the target front-end page by means of hardware disconnection.
[0138] On the basis of the above-mentioned embodiments, the post-processing code generation module can be further included, which is configured to:
[0139] if it is determined that the tracking result post-processing information is further included in the monitoring requirement information, generating the tracking result post-processing logic code according to the tracking result post-processing information;
[0140] Correspondingly, the post-processing code adding module can be further included, which is configured to:
[0141] adding the tracking result post-processing logic code into the engineering file matching the target front-end page while adding the event tracking plug-in into the engineering file matching the target front-end page.
[0142] The componentized generation device of the event tracking plug-in provided in the embodiments of the application can execute the componentized generation method of the event tracking plug-in provided in any of the embodiments of the application, and has the corresponding function modules and beneficial effects of the execution method.
[0143] The collection, storage, use, processing, transmission, provision and disclosure of the user personal information in the technical solutions of the present disclosure comply with relevant laws and regulations and do not violate public order and good customs.
[0144] It needs to be emphasized again that the user behavior information or page usage information collected by the event tracking plug-in added in the target front page is information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws and regulations and standards of relevant countries and regions, necessary security measures are taken, public order and good customs are not violated, and corresponding operation entrances are provided for the user to choose authorization or refusal.
[0145] Figure 4 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown in the figures, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the applications described and / or claimed in this document.
[0146] As shown in Figure 4 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11, wherein the memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0147] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0148] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as performing the componentized generation method of the event tracking plug-in as described in any one of the embodiments of the present application.
[0149] That is, in response to the monitoring demand information matching the target front-end page issued by the demand side, at least one piece of monitoring description information is constructed, and the monitoring description information includes a set indicator value required to be monitored under the set monitoring indicator;
[0150] Among the pre-constructed monitoring components, target monitoring components corresponding to each monitoring description information are obtained, wherein the monitoring components are implemented through programming code constructed based on the listener;
[0151] If a target monitoring component in which the monitoring indicator is the user browsing data is identified among the target monitoring components, the identified target monitoring component is reconstructed using the matched monitoring description information;
[0152] After splicing each target monitoring component according to a preset component splicing manner, an event tracking plug-in matching the target front-end page is obtained, and the event tracking plug-in is added to the project file matching the target front-end page.
[0153] In some embodiments, the componentized generation method of an event tracking plug-in as described in any of the embodiments of the application can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 18. In some embodiments, parts or all of the computer program can be loaded and / or installed onto electronic device 10 via, e.g., ROM 12 and / or communication unit 19. When the computer program is loaded onto RAM 13 and executed by processor 11 as aforementioned, one or more steps of the componentized generation method of an event tracking plug-in as described in any of the embodiments of the application can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the componentized generation method of an event tracking plug-in as described in any of the embodiments of the application by any other suitable means, e.g., with the aid of firmware.
[0154] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0155] Computer programs used to implement the methods of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0156] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0157] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0158] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0159] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0160] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.
[0161] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for componentized generation of an event tracking plug-in, the method comprising: The method comprises the following steps: In response to the monitoring demand information issued by the demand side and matched with the target front-end page, at least one monitoring description information is constructed, and the monitoring description information includes the set index value required to be monitored under the set monitoring index; In the pre-constructed monitoring components, the target monitoring components corresponding to each monitoring description information are obtained, wherein the monitoring components are implemented through programming code constructed based on the listener; If a target monitoring component with a monitoring index of user browsing data is identified in the target monitoring components, the identified target monitoring component is reconstructed using the matched monitoring description information; After splicing the target monitoring components according to the preset component splicing mode, an event tracking plug-in matched with the target front-end page is obtained, and the event tracking plug-in is added to the project file matched with the target front-end page.
2. The method of claim 1, wherein, After obtaining the target monitoring components corresponding to each monitoring description information in the pre-constructed monitoring components, the method further comprises the following steps: If no monitoring component precisely matched with the target monitoring description information is searched, a plurality of alternative monitoring components satisfying a similarity condition with the target monitoring description information are obtained through fuzzy matching; The component source code corresponding to each alternative monitoring component is obtained, and the component source code is fused based on the target monitoring description information through a large language model to obtain fused source code; A code programming interface matched with the programming type of the monitoring component is triggered and opened, and the fused source code is displayed in the code programming interface for secondary programming by a developer; In response to a confirmation instruction generated by the developer after completing the secondary programming, a target monitoring component matched with the target monitoring description information is generated according to the target source code currently displayed in the code programming interface.
3. The method of claim 2, wherein, After triggering the code programming interface matched with the programming type of the monitoring component, the method further comprises the following steps: According to the pre-constructed basic calculation logic components, a prompt word template is generated, and the target monitoring description information and the prompt word template are input into the large language model; The target basic calculation logic component filtered from the basic calculation logic components by the large language model for the target monitoring description information is obtained; Each target basic calculation logic component is displayed in the code programming interface.
4. The method of claim 1, wherein, If a target monitoring component with a monitoring index of user browsing data is identified in the target monitoring components, the identified target monitoring component is reconstructed using the matched monitoring description information, which comprises the following steps: The monitoring description information matched with the target monitoring component with the monitoring index of user browsing data is obtained; According to the obtained monitoring description information, the identification information of at least one user click control in the target front-end page is located; According to the located identification information, the target monitoring component with the monitoring index of user browsing data is reconstructed.
5. The method according to any one of claims 1 to 4, characterized in that, The monitoring description information further includes the set index value required to be monitored by the set monitoring logic under the set monitoring index; Correspondingly, the target monitoring components are spliced according to the preset component splicing mode, which comprises the following steps: According to the monitoring logic dynamic update information included in the monitoring demand information, the first monitoring description information and the second monitoring description information are identified in the monitoring description information; The first monitoring description information and the second monitoring description information have the same monitoring index and index value, and different monitoring logics. The first environment condition matched with the first monitoring logic in the first monitoring description information and the second environment condition matched with the second monitoring logic in the second monitoring description information are extracted from the monitoring logic dynamic update information, and a component selection logic template is constructed according to the first environment condition and the second environment condition; The first target monitoring component matched with the first monitoring description information and the second target monitoring component matched with the second monitoring description information are filled into the component selection logic template, so as to splice the first target monitoring component and the second target monitoring component.
6. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: If it is determined that the monitoring requirement information contains high-level privacy protection requirement, a quick protection plug-in is constructed; Correspondingly, when the event tracking plug-in is added to the engineering file matched with the target front-end page, the method further comprises: The quick protection plug-in is synchronously added to the engineering file matched with the target front-end page; The quick protection plug-in is used to, in the process that the user browses the target front-end page, according to the event tracking authorization revocation instruction sent by the user in real time, block the event tracking plug-in from continuing to track the target front-end page by means of hardware disconnection.
7. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: If it is determined that the monitoring requirement information further contains tracking result post-processing information, tracking result post-processing logic code is generated according to the tracking result post-processing information; Correspondingly, when the event tracking plug-in is added to the engineering file matched with the target front-end page, the method further comprises: The tracking result post-processing logic code is added to the engineering file matched with the target front-end page.
8. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the componentized generation method of the event tracking plug-in according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to execute the componentized generation method of the event tracking plug-in according to any one of claims 1-7 when executed.
10. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program, when executed by the processor, implements the componentized generation method of the event tracking plug-in according to any one of claims 1-7.