A method, apparatus, electronic device, and storage medium for reporting page tracking points.

CN116415094BActive Publication Date: 2026-08-14JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-16
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

但是Flutter作为一种描述性用户界面(User Interface,UI)框架,本身并没有提供UI组件的曝光时机,这给数据的埋点带来了挑战,增加埋点成本

Benefits of technology

[0038]本申请实施例提供一种页面埋点上报方法、装置、电子设备和计算机存储介,所述方法应用于页面埋点上报系统,所述系统包括曝光控制器,所述方法包括:确定添加至目标页面的至少一个曝光埋点;每一曝光埋点是根据产品业务需求定义的,且所述每一曝光埋点具有唯一的标识信息;利用所述曝光控制器获取所述每一曝光埋点对应的路由事件的监听结果;基于所述监听结果,确定所述曝光控制器的当前状态,并根据所述曝光控制器的当前状态,确定所述每一曝光埋点的展示区域;根据所述每一曝光埋点的展示区域和标识信息,实现对应埋点数据的上报。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116415094B_ABST
    Figure CN116415094B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, electronic device, and computer storage medium for reporting page event tracking data. The method includes: determining at least one exposure event tracking point to be added to a target page; each exposure event tracking point is defined according to product business requirements, and each exposure event tracking point has unique identification information; using the exposure controller to obtain the listening result of the routing event corresponding to each exposure event tracking point; based on the listening result, determining the current state of the exposure controller, and determining the display area of ​​each exposure event tracking point according to the current state of the exposure controller; and reporting the corresponding event tracking point data according to the display area and identification information of each exposure event tracking point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a method, apparatus, electronic device, and computer storage medium for reporting page tracking points. Background Technology

[0002] Currently, user behavior data analysis is an essential part of internet products. As more and more applications (Apps) are developed using Flutter technology, the demand for data tracking is increasing. However, Flutter, as a descriptive user interface (UI) framework, does not provide information on the exposure timing of UI components, which poses a challenge to data tracking and increases its cost.

[0003] In related technologies, developers use a full-tracking (i.e., automatic tracking) solution. Ideally, this solution only requires developers to integrate it once, and no further development is needed in subsequent iterations. This solution requires automatic data collection, generating corresponding Identity Documents (IDs) for elements such as pages and components. However, generating IDs uses class names and component paths in the component tree, which are easily changed with code modifications. Even components within the same business scenario may generate different IDs due to different conditions. Therefore, ID discontinuity frequently occurs, and changes cannot be detected promptly, leading to inaccurate data collection and increased maintenance costs. Furthermore, the full-tracking solution generates a large amount of useless data, increasing data processing pressure. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, and computer storage medium for reporting page tracking points.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] This application provides a page tracking reporting method, applied to a page tracking reporting system, the system including an exposure controller, the method including:

[0007] Identify at least one exposure tracking point to be added to the target page; each exposure tracking point is defined according to the product business requirements, and each exposure tracking point has unique identification information;

[0008] The exposure controller is used to obtain the listening results of the routing events corresponding to each exposure point;

[0009] Based on the monitoring results, the current state of the exposure controller is determined, and the display area of ​​each exposure point is determined according to the current state of the exposure controller.

[0010] Based on the display area and identification information of each exposure point, the corresponding data of the exposure point is reported.

[0011] In some embodiments, determining the display area of ​​each exposure point based on the current state of the exposure controller includes:

[0012] The RenderBox corresponding to each exposure point is obtained through the AfterLayout widget;

[0013] The exposure area corresponding to each exposure point is obtained through InheritedScope;

[0014] Each exposure point is recorded in the corresponding exposure area;

[0015] Based on the current state of the exposure controller and the RenderBox corresponding to each exposure point recorded in the exposure area, the display area of ​​each exposure point is determined.

[0016] In some embodiments, when the exposure tracking point is a page exposure tracking point, the exposure area corresponding to the page exposure tracking point is the exposure controller. Determining the display area of ​​each exposure tracking point based on the current state of the exposure controller and the RenderBox corresponding to each exposure tracking point recorded in the exposure area includes:

[0017] Initiate a delayed task using the exposure controller;

[0018] After the delay task reaches the delay duration, determine whether the current state of the exposure controller meets the requirements;

[0019] If the current state of the exposure controller meets the requirements, the page exposure tracking points recorded in the exposure controller are traversed, and the display area of ​​the page exposure tracking point is determined according to the RenderBox corresponding to the traversed page exposure tracking point.

[0020] In some embodiments, when the exposure tracking point is a component exposure tracking point, the exposure area corresponding to the component exposure tracking point is the page exposure tracking point, and the method further includes:

[0021] After determining the display area of ​​the page exposure tracking point, the component exposure tracking points recorded in the page exposure tracking point are traversed, and the display area of ​​the component exposure tracking point is determined according to the RenderBox corresponding to the traversed component exposure tracking point.

[0022] In some embodiments, the method further includes:

[0023] Identify the current component associated with the exposure tracking point of the component;

[0024] Perform a hit test on the descendant components of the current component to obtain the test results;

[0025] Based on the test results, the click event was reported.

[0026] In some embodiments, reporting the click event based on the test results includes:

[0027] If, based on the test results, it is determined that the descendant component includes a clickable component, the rejectGesture method of the current component is overridden using a custom tap gesture recognizer.

[0028] Based on the rewritten `rejectGesture` method of the current component, the click event is reported.

[0029] In some embodiments, obtaining the listening results of the routing events corresponding to each exposure point using the exposure controller includes:

[0030] The exposure controller listens to the routing events corresponding to each exposure point through the RouteAware interface and obtains the listening results.

[0031] This application provides a page tracking point reporting device, applied to a page tracking point reporting system. The system includes an exposure controller, and the device includes a first determining module, an acquisition module, a second determining module, and a reporting module.

[0032] The first determining module is used to determine at least one exposure tracking point to be added to the target page; each exposure tracking point is defined according to the product business requirements, and each exposure tracking point has unique identification information;

[0033] The acquisition module is used to acquire the listening results of the routing events corresponding to each exposure point using the exposure controller;

[0034] The second determining module is used to determine the current state of the exposure controller based on the monitoring results, and to determine the display area of ​​each exposure point according to the current state of the exposure controller.

[0035] The reporting module is used to report the corresponding data of each exposure point based on the display area and identification information of each exposure point.

[0036] This application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the page tracking reporting method provided by one or more of the aforementioned technical solutions.

[0037] This application provides a computer storage medium storing a computer program; when the computer program is executed, it can implement the page tracking reporting method provided by one or more of the aforementioned technical solutions.

[0038] This application provides a method, apparatus, electronic device, and computer storage medium for reporting page tracking points. The method is applied to a page tracking point reporting system, which includes an exposure controller. The method includes: determining at least one exposure tracking point to be added to a target page; each exposure tracking point is defined according to product business requirements and has unique identification information; using the exposure controller to obtain the listening result of the routing event corresponding to each exposure tracking point; based on the listening result, determining the current state of the exposure controller, and determining the display area of ​​each exposure tracking point according to the current state of the exposure controller; and reporting the corresponding tracking point data according to the display area and identification information of each exposure tracking point.

[0039] As can be seen from the embodiments of this application, each exposure tracking point added to the target page has unique identification information; that is, the identification information of each exposure tracking point is predefined and does not need to be automatically generated during the tracking process. In this way, the problems of inaccurate data collection and high maintenance costs caused by automatically generated element IDs in related technologies can be solved. In addition, since each exposure tracking point on the target page is actively added by the developer according to the product business needs, the necessary components of the target page can be tracked more accurately, reducing the reporting of useless data, reducing the pressure of data processing, and ensuring data stability. Attached Figure Description

[0040] Figure 1 This is a flowchart of a page tracking point reporting method according to an embodiment of this application;

[0041] Figure 2 This is a schematic diagram of the data structure of a target page according to an embodiment of this application;

[0042] Figure 3 This is a schematic diagram of the structure of a page tracking point reporting system according to an embodiment of this application;

[0043] Figure 4 This is a schematic diagram of the composition structure of a page embedding point reporting device according to an embodiment of this application;

[0044] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0045] The technical solutions in this application will now be clearly and completely described with reference to the accompanying drawings.

[0046] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are merely illustrative of the present application and are not intended to limit the present application. Furthermore, the embodiments provided below are some embodiments for implementing the present application, and not all embodiments for implementing the present application. Unless otherwise specified, the technical solutions described in the present application can be implemented in any combination.

[0047] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other related elements (e.g., steps in the method or units in the apparatus, such as portions of a processor, program, or software, etc.) in the method or apparatus that includes that element.

[0048] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0049] In some embodiments of this application, the page tracking reporting method can be implemented using a processor in the page tracking reporting device. The processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor.

[0050] Event tracking is a common data collection method. By placing event tags on application pages, user data corresponding to those pages can be obtained. The accuracy of user data is crucial for subsequent decision-making, making it essential to ensure the correctness of event tracking. Therefore, event tracking testing is usually required before an application goes live.

[0051] Figure 1 This is a flowchart of a page tracking point reporting method according to an embodiment of this application, such as... Figure 1 As shown, the process may include:

[0052] Step 10: Determine at least one exposure tracking point to be added to the target page.

[0053] For example, the target page can be a Flutter page defined according to product business requirements, which represent business requirements related to internet products. The basic building blocks of a Flutter page are widgets, each of which can contain one or more widgets. Through layers of wrapping, a widget tree is ultimately constructed. That is, the data structure of a Flutter page is a widget tree composed of multiple widgets, and the widget tree only contains containment relationships. See [link to relevant documentation]. Figure 2 .

[0054] Figure 2 This is a schematic diagram of the data structure of a target page according to an embodiment of this application, such as... Figure 2As shown, the structure diagram includes three custom components: exposure controller, page exposure anchor, and component exposure anchor, as well as official components provided by the Flutter SDK: Scaffold, PageView, and UI component widget; the components shown in the diagram are in a containment relationship from top to bottom, with lower levels being child nodes of higher levels.

[0055] It should be noted that the basic building blocks of the three custom components mentioned above are all Flutter widgets. You only need to wrap the widget that needs to be exposed with these three custom components. It is simple and easy to use. The following is a description of these three custom components.

[0056] In this context, the exposure controller and page route have a one-to-one relationship. Page exposure tracking is page-level exposure tracking with no subordinate tracking points; in most scenarios, it is also one-to-one with the page route. However, if a multi-page view component (PageView) is used, the business logic might treat each page element as a complete page, in which case one page route corresponds to multiple page exposure tracking points. Component exposure tracking is a specific element within the page, belonging to the page exposure tracking; that is, component exposure tracking is a component exposure tracking point within the page. This is because when performing tracking data statistics, it is generally necessary to associate elements within the page with the page itself. Additionally, component exposure tracking supports click tracking, enabling more granular tracking statistics.

[0057] In this embodiment of the application, each of the at least one exposure tracking points is defined according to the product business requirements and then manually added to the target page by the developers.

[0058] For example, the at least one exposure tracking point added to the target page includes the case of one exposure tracking point and multiple exposure tracking points; when at least one exposure tracking point is one exposure tracking point, the exposure tracking point is a page exposure tracking point; when at least one exposure tracking point is multiple exposure tracking points, at least one of the multiple exposure tracking points is a page exposure tracking point, and the remaining exposure tracking points can be component exposure tracking points, or a combination of page exposure tracking points and component exposure tracking points.

[0059] For example, if the target page is a shopping cart page, the entire page needs to be tracked for exposure, that is, a page exposure tracking point needs to be added accordingly; in addition, each product in the shopping cart page also needs to be tracked for exposure, that is, each component exposure tracking point needs to be added accordingly.

[0060] It should be noted that each exposure tracking point is given a unique identifier before being added to the target page. This identifier can be an ID, which is usually represented by a string.

[0061] For example, if the target page is a shopping cart page, the ID of the page exposure tracking point can be defined as page_id_shopping_trolley. This ID can then be passed into the constructor of the page exposure tracking point. When the shopping cart page is displayed, the page exposure tracking point will report the corresponding tracking data, along with its own ID.

[0062] Step 11: Use the exposure controller to obtain the listening results of the routing events corresponding to each exposure point.

[0063] In some embodiments, obtaining the listening results of the routing events corresponding to each exposure point using the exposure controller may include: the exposure controller listening to the routing events corresponding to each exposure point through the RouteAware interface and obtaining the listening results.

[0064] For example, the RouteAware interface is a page route switching listener interface, which is a component provided by the Flutter SDK for monitoring pages. It can listen for corresponding route events when the page is shown and hidden.

[0065] In this embodiment of the application, the exposure controller listens to the routing events corresponding to each exposure point through the RouteAware interface, and then obtains the listening results of the routing events corresponding to each exposure point.

[0066] For example, the listening results can include the following two types: push messages for routes that were listened to and push messages for routes that were not listened to.

[0067] Step 12: Based on the monitoring results, determine the current state of the exposure controller, and determine the display area of ​​each exposure point according to the current state of the exposure controller;

[0068] For example, determining the current state of the exposure controller based on the listening results may include: if it is determined that a push message for a route has been heard based on the listening results, then the current state of the exposure controller is marked as the display state; otherwise, if it is determined that no push message for a route has been heard based on the listening results, then the original state of the exposure controller remains unchanged.

[0069] In some embodiments, determining the display area of ​​each exposure point based on the current state of the exposure controller includes: obtaining the RenderBox corresponding to each exposure point through the AfterLayout widget; obtaining the exposure area corresponding to each exposure point through InheritedScope; recording each exposure point in the corresponding exposure area; and determining the display area of ​​each exposure point based on the current state of the exposure controller and the RenderBox corresponding to each exposure point already recorded in the exposure area.

[0070] For example, the following explanation uses exposure tracking points as page exposure tracking points. After the layout stage of the target page rendering is completed, the page exposure tracking points will obtain the corresponding RenderBox through the AfterLayout widget. Subsequently, the position information of the page exposure tracking points on the screen can be calculated through the RenderBox, and the display area of ​​the page exposure tracking points can be determined based on the position information.

[0071] For example, the page exposure tracking point will obtain the corresponding exposure area through InheritedScope and record itself in the exposure area; it should be noted that the exposure area corresponding to the page exposure tracking point is the exposure controller.

[0072] Furthermore, once the exposure controller determines that the page exposure points have been recorded, it will determine the display area of ​​each exposure point based on the current state of the exposure controller and the RenderBox corresponding to the page exposure points already recorded in the exposure area.

[0073] In some embodiments, determining the display area of ​​each exposure point based on the current state of the exposure controller and the RenderBox corresponding to each exposure point recorded in the exposure area may include: starting a delay task using the exposure controller; after the delay task reaches the delay duration, determining whether the current state of the exposure controller meets the requirements; if the current state of the exposure controller meets the requirements, traversing the page exposure points recorded in the exposure controller, and determining the display area of ​​the page exposure points based on the RenderBox corresponding to the traversed page exposure points.

[0074] Here, the delay duration of the delayed task can be set according to the actual situation, and this application embodiment does not limit it; for example, the delay duration can be set to 10ms.

[0075] For example, after the delay task reaches the delay duration, if the current state of the exposure controller is the display state, it is determined that the current state of the exposure controller meets the requirements; otherwise, if the current state of the exposure controller is not the display state, it is determined that the current state of the exposure controller does not meet the requirements.

[0076] For example, if the current state of the exposure controller is determined to be the display state, the exposure controller is used to traverse the recorded page exposure points, and the display area of ​​the page exposure points is determined according to the RenderBox corresponding to the traversed page exposure points.

[0077] Understandably, starting a time-delay task can reduce the frequency of exposure calculations, reduce data instability caused by frequent calculations, and thus achieve noise reduction.

[0078] In some embodiments, when the exposure tracking point is a component exposure tracking point, the exposure area corresponding to the component exposure tracking point is the page exposure tracking point. The above method may further include: after determining the display area of ​​the page exposure tracking point, traversing the component exposure tracking points recorded in the page exposure tracking point, and determining the display area of ​​the component exposure tracking point according to the RenderBox corresponding to the traversed component exposure tracking point.

[0079] It's important to note that the implementation principle of component exposure tracking is basically similar to that of page exposure tracking. After determining the display area of ​​the page exposure tracking—that is, after the result of whether the page exposure tracking is exposed is calculated—the exposure calculation of the component exposure tracking is triggered, and the page exposure tracking is used to iterate through the recorded component exposure tracking. The difference is that after the component exposure tracking is laid out, it records itself in the corresponding page exposure tracking, because the page exposure tracking is not only an exposure element but also an exposure area, inheriting from ExposureScope.

[0080] For example, the calculation of the display area of ​​a component's exposure tracking point on the screen can be as follows: the state class corresponding to the component's exposure tracking point obtains its own screen-based global coordinates through the RenderBox's localToGlobal method, then obtains the position of the corresponding compositing layer on the screen, and performs a bitwise AND operation between the two to obtain the display area of ​​the component's exposure tracking point. If the ratio of the display area to the size of the component's exposure tracking point itself is greater than the display ratio, it is considered that an exposure has occurred.

[0081] For example, the `localToGlobal` method of `RenderBox` can obtain the global coordinates of a component's exposure tracking point based on the screen. However, these global coordinates may extend beyond the screen; for instance, many views on a waterfall layout are off-screen and only appear when scrolling upwards. Next, the global coordinates of the root view (`renderView`) are obtained, and then a region overlap operation is performed with the global coordinates of the compositing layer's clipping region (if any) to obtain the display area of ​​the compositing layer where the component's exposure tracking point is located. Afterwards, a region overlap operation is performed between the component's exposure tracking point and the display position of the compositing layer based on the screen's global coordinates—corresponding to the above AND operation—to obtain the actual display area of ​​the component's exposure tracking point.

[0082] Here, the display ratio can be set using the visiblePercent function of ExposureConfig (ExposureConfig is used to store global configuration parameters, such as exposure event callbacks, display ratio, whether to enable debug logs, etc.); the value of the display ratio can be set according to the actual situation, for example, it can be set to 50%.

[0083] Step 13: Based on the display area and identification information of each exposure point, report the corresponding data for that exposure point.

[0084] For example, after obtaining the display area of ​​each exposure point according to the above steps, it is determined whether each exposure point is on the screen based on the display area of ​​each exposure point. If it is determined to be on the screen, the corresponding exposure point data is reported based on the identification information of each exposure point. If it is determined not to be on the screen, the data is not reported at this time.

[0085] Furthermore, after each report of the data points, the data points can be promptly removed from the data set to reduce data anomalies caused by duplicate reports.

[0086] This application provides a page tracking point reporting method, which is applied to a page tracking point reporting system. The system includes an exposure controller. The method includes: determining at least one exposure tracking point to be added to a target page; each exposure tracking point is defined according to product business requirements and has unique identification information; using the exposure controller to obtain the listening result of the routing event corresponding to each exposure tracking point; based on the listening result, determining the current state of the exposure controller, and determining the display area of ​​each exposure tracking point according to the current state of the exposure controller; and reporting the corresponding tracking point data according to the display area and identification information of each exposure tracking point. It can be seen that in this application embodiment, each exposure tracking point added to the target page has unique identification information; that is, the identification information of each exposure tracking point is predefined and does not need to be automatically generated during the tracking process. In this way, the problems of inaccurate data collection and high maintenance costs caused by automatically generated element IDs in related technologies can be solved. In addition, since each exposure tracking point on the target page is actively added by the developer according to product business requirements, the necessary components of the target page can be tracked more accurately, reducing the reporting of useless data, reducing the pressure of data processing, and ensuring data stability.

[0087] In some embodiments, the above method may further include: determining the current component associated with the component exposure tracking point; performing a hit test on the descendant components of the current component to obtain the test result; and completing the reporting of the click event based on the test result.

[0088] For example, component exposure tracking can be implemented using ExposureClick to capture click events. Flutter's click events are mainly divided into three stages: hit testing, event dispatch, and event contention. The click tracking in this embodiment can be implemented through the hit testing and event contention stages.

[0089] For example, in the hit testing phase, the current component associated with the component exposure tracking point is first determined, and the hit test is performed on the descendant components of the current component to obtain the test results. The test results include: the descendant components include clickable components that have hit the test, and the descendant components do not include clickable components that have hit the test. Here, when the descendant components include clickable components that have hit the test, ExposureClick is set to hit; when the descendant components do not include clickable components that have hit the test, ExposureClick is set to miss.

[0090] Here, ExposureClick can be understood as a virtual button, while the real buttons are the descendant widgets of ExposureClick (Flutter uses a widget tree to describe the UI; each widget, except for the root node, has a parent widget). In subsequent event competition, the descendant widget always wins because it is always at the top of the competitor list, and the Flutter SDK only allows one clickable component to be hit in the test.

[0091] In some embodiments, reporting click events based on test results may include: if, based on the test results, it is determined that the descendant components include clickable components, rewriting the rejectGesture method of the current component using a custom click gesture recognizer (TapGestureRecognizer); and reporting click events based on the rewritten rejectGesture method of the current component.

[0092] For example, during the event competition phase, only clickable components that are tested will participate in the event competition. Therefore, once ExposureClick reaches the event competition phase, it means that a click exposure is needed. In Flutter's system solution, only one clickable component can win the competition. As the ancestor widget of the clickable component, ExposureClick will definitely lose in the event competition, resulting in the inability to capture the click event.

[0093] For example, during the event competition phase, clickable components are added to a list, with child components ahead of parent components. When a child component wins the competition, its `acceptGesture` method is executed, while the parent component's (referring to the click event tracker) `rejectGesture` method is executed. In this embodiment, a custom click gesture recognizer `TapGestureRecognizer` is defined, and the parent component's `rejectGesture` method is overridden to force the execution of the `acceptGesture` method. This results in two components winning the event competition: one is the actual clickable component, such as a button, and the other is the click event tracker `ExposureClick`, thereby triggering the reporting of click events.

[0094] As can be seen, the embodiments of this application realize manual exposure of business through three elements: exposure controller, page exposure tracking, and component exposure tracking. The operation is simple and the development workload is small. At the same time, component exposure tracking supports the capture of click events to realize click tracking.

[0095] To better illustrate the purpose of this application, further explanation will be provided based on the above embodiments.

[0096] This application also provides a schematic diagram of the structure of a page tracking and reporting system, such as... Figure 3 As shown, the system includes an ExposureController, an ExposurePage event tracker, and an ExposureItem event tracker. Figure 3 The arrows 1 and N represent UML containment relationships, indicating that one component can contain multiple components. The `InheritedScope` class inherits from `InheritedWidgets`, which are components provided by the Flutter SDK for fast and efficient data sharing within a widget tree. `InheritedScope` is used to associate a component's `ExposureItem` with a page's `ExposurePage`. This is because when reporting the event data corresponding to a component's `ExposureItem`, the event data of components within the page needs to be associated with the page's `ExposurePage` for reporting.

[0097] For example, the ExposureController, the page exposure tracking point ExposurePage, and the component exposure tracking point ExposureItem are all stateful widgets. The state class corresponding to the ExposureController is ExposureControllerState, which can be simply referred to as the state-class ExposureController; the state class corresponding to the page exposure tracking point ExposurePage is ExposurePageState, which can be simply referred to as the state-class page exposure tracking point; and the state class corresponding to the component exposure tracking point ExposureItem is ExposureItemState, which can be simply referred to as the state-class component exposure tracking point.

[0098] Here, taking the ExposureController as an example, we will explain the relationship between the ExposureController and ExposureControllerState. The ExposureController can be understood as the external interface, and the ExposureControllerState can be understood as the actual code implementation.

[0099] ExposureRenderBox inherits from RenderBox and is used to listen for page layout events, calculate the display area, and determine whether the corresponding component is displayed on the screen based on the display area. It should be noted that the above embodiments have been combined with... Figure 3 The process of page exposure tracking, component exposure tracking, and click tracking has been explained in the section shown, and will not be repeated here.

[0100] Figure 4 This is a schematic diagram of the composition structure of a page embedding and reporting device according to an embodiment of this application, used for... Figure 1 The specific implementation of the method, such as Figure 4 As shown, the device includes: a first determining module 40, an acquiring module 41, a second determining module 42, and a reporting module 43, wherein,

[0101] The first determining module 40 is used to determine at least one exposure tracking point to be added to the target page; each exposure tracking point is defined according to the product business requirements, and each exposure tracking point has unique identification information;

[0102] The acquisition module 41 is used to acquire the listening result of the routing event corresponding to each exposure point using the exposure controller;

[0103] The second determining module 42 is used to determine the current state of the exposure controller based on the monitoring results, and to determine the display area of ​​each exposure point according to the current state of the exposure controller.

[0104] The reporting module 43 is used to report the corresponding data of each exposure point based on the display area and identification information of each exposure point.

[0105] In some embodiments, the second determining module 42 is further configured to:

[0106] The RenderBox corresponding to each exposure point is obtained through the AfterLayout widget;

[0107] The exposure area corresponding to each exposure point is obtained through InheritedScope;

[0108] Each exposure point is recorded in the corresponding exposure area;

[0109] Based on the current state of the exposure controller and the RenderBox corresponding to each exposure point recorded in the exposure area, the display area of ​​each exposure point is determined.

[0110] In some embodiments, when the exposure tracking point is a page exposure tracking point, the exposure area corresponding to the page exposure tracking point is the exposure controller, and the second determining module 42 is further configured to:

[0111] Initiate a delayed task using the exposure controller;

[0112] After the delay task reaches the delay duration, determine whether the current state of the exposure controller meets the requirements;

[0113] If the current state of the exposure controller meets the requirements, the page exposure tracking points recorded in the exposure controller are traversed, and the display area of ​​the page exposure tracking point is determined according to the RenderBox corresponding to the traversed page exposure tracking point.

[0114] In some embodiments, when the exposure tracking point is a component exposure tracking point, the exposure area corresponding to the component exposure tracking point is the page exposure tracking point, and the second determining module 42 is further configured to:

[0115] After determining the display area of ​​the page exposure tracking point, the component exposure tracking points recorded in the page exposure tracking point are traversed, and the display area of ​​the component exposure tracking point is determined according to the RenderBox corresponding to the traversed component exposure tracking point.

[0116] In some embodiments, the reporting module 43 is further configured to:

[0117] Identify the current component associated with the exposure tracking point of the component;

[0118] Perform a hit test on the descendant components of the current component to obtain the test results;

[0119] Based on the test results, the click event was reported.

[0120] In some embodiments, the reporting module 43 is further configured to:

[0121] If, based on the test results, it is determined that the descendant component includes a clickable component, the rejectGesture method of the current component is overridden using a custom tap gesture recognizer, TapGestureRecognizer.

[0122] Based on the rewritten `rejectGesture` method of the current component, the click event is reported.

[0123] In some embodiments, the acquisition module 41 is further configured to: the exposure controller listens to the routing events corresponding to each exposure point through the RouteAware interface and obtains the listening results.

[0124] In practical applications, the first determining module 40, the obtaining module 41, the second determining module 42, and the reporting module 43 can all be implemented by a processor located in an electronic device. The processor can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.

[0125] Furthermore, in this embodiment, the functional modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.

[0126] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0127] Specifically, the computer program instructions corresponding to a page tracking reporting method in this embodiment can be stored on storage media such as optical discs, hard disks, and USB flash drives. When the computer program instructions corresponding to a page tracking reporting method in the storage media are read or executed by an electronic device, any of the page tracking reporting methods in the aforementioned embodiments can be implemented.

[0128] Based on the same technical concept as the foregoing embodiments, see Figure 5 This application also provides an electronic device 50, which may include: a memory 51 and a processor 52; wherein,

[0129] Memory 51 is used to store computer programs and data;

[0130] The processor 52 is used to execute a computer program stored in the memory to implement any of the page tracking reporting methods in the foregoing embodiments.

[0131] In practical applications, the aforementioned memory 51 can be volatile memory, such as RAM; or non-volatile memory, such as ROM, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 52.

[0132] The processor 52 described above can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It is understood that for different page embedding reporting devices, the electronic device used to implement the above processor function can also be other types, and this application embodiment does not specifically limit the specific types.

[0133] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0134] The descriptions of the various embodiments above tend to emphasize the differences between them. Similarities or commonalities can be referenced interchangeably, and for the sake of brevity, they will not be repeated here. The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0135] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments. Similarly, the features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0136] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0137] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0138] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0139] The above are merely preferred embodiments of this application and are not intended to limit the scope of protection of this application.

Claims

1. A method for reporting page tracking points, characterized in that, The method, applied to a page tracking and reporting system, includes an exposure controller and comprises: Identify at least one exposure tracking point to be added to the target page; each exposure tracking point is defined according to product business requirements, and each exposure tracking point has unique identification information; the target page is a Flutter page defined according to product business requirements; The exposure controller is used to obtain the listening results of the routing events corresponding to each exposure point; Based on the monitoring results, the current state of the exposure controller is determined, and the display area of ​​each exposure point is determined according to the current state of the exposure controller. Based on the display area and identification information of each exposure point, the corresponding data of the exposure point is reported. Determining the display area of ​​each exposure point based on the current state of the exposure controller includes: The RenderBox corresponding to each exposure point is obtained through the AfterLayout widget; the AfterLayout widget inherits from SingleChildRenderObjectWidget. The exposure area corresponding to each exposure point is obtained through InheritedScope; InheritedScope is inherited from the Inherited widget. Each exposure point is recorded in the corresponding exposure area; Based on the current state of the exposure controller and the RenderBox corresponding to each exposure point recorded in the exposure area, the display area of ​​each exposure point is determined.

2. The method according to claim 1, characterized in that, When the exposure tracking point is a page exposure tracking point, the exposure area corresponding to the page exposure tracking point is the exposure controller. Determining the display area of ​​each exposure tracking point based on the current state of the exposure controller and the RenderBox corresponding to each exposure tracking point recorded in the exposure area includes: Initiate a delayed task using the exposure controller; After the delay task reaches the delay duration, determine whether the current state of the exposure controller meets the requirements; If the current state of the exposure controller meets the requirements, the page exposure tracking points recorded in the exposure controller are traversed, and the display area of ​​the page exposure tracking point is determined according to the RenderBox corresponding to the traversed page exposure tracking point.

3. The method according to claim 2, characterized in that, When the exposure tracking point is a component exposure tracking point, the exposure area corresponding to the component exposure tracking point is the page exposure tracking point, and the method further includes: After determining the display area of ​​the page exposure tracking point, the component exposure tracking points recorded in the page exposure tracking point are traversed, and the display area of ​​the component exposure tracking point is determined according to the RenderBox corresponding to the traversed component exposure tracking point.

4. The method according to claim 3, characterized in that, The method further includes: Identify the current component associated with the exposure tracking point of the component; Perform a hit test on the descendant components of the current component to obtain the test results; Based on the test results, the click event was reported.

5. The method according to claim 4, characterized in that, The reporting of click events based on the test results includes: If, based on the test results, it is determined that the descendant component includes a clickable component, the rejectGesture method of the current component is overridden using a custom click gesture recognizer. Based on the rewritten `rejectGesture` method of the current component, the click event is reported.

6. The method according to claim 1 or 2, characterized in that, The step of obtaining the listening results of the routing events corresponding to each exposure point using the exposure controller includes: The exposure controller listens to the routing events corresponding to each exposure point through the RouteAware interface and obtains the listening results.

7. A page embedding point reporting device, characterized in that, An application is used in a page tracking and reporting system, the system including an exposure controller, the device including: The first determining module is used to determine at least one exposure tracking point to be added to the target page; each exposure tracking point is defined according to product business requirements, and each exposure tracking point has unique identification information; the target page is a Flutter page defined according to product business requirements. The acquisition module is used to acquire the listening results of the routing events corresponding to each exposure point using the exposure controller; The second determining module is used to determine the current state of the exposure controller based on the monitoring results, and to determine the display area of ​​each exposure point according to the current state of the exposure controller. The reporting module is used to report the corresponding data of each exposure point based on the display area and identification information of each exposure point. The second determining module is further configured to obtain the RenderBox corresponding to each exposure tracking point through the AfterLayout widget; the AfterLayout widget inherits from SingleChildRenderObjectWidget; obtain the exposure area corresponding to each exposure tracking point through InheritedScope; the InheritedScope inherits from the Inherited widget; record each exposure tracking point in the corresponding exposure area; and determine the display area of ​​each exposure tracking point based on the current state of the exposure controller and the RenderBox corresponding to each exposure tracking point recorded in the exposure area.

8. An electronic device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method according to any one of claims 1 to 6.

9. A computer storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Point burying method and device, electronic equipment and storage medium

    CN111435298A

  • Burial point reporting method and device, equipment and storage medium

    CN112989162A

  • Page point burying method and device, electronic equipment and medium

    CN115328478A