An advertisement burying point testing method and related device
By combining a unified processing function and a custom parameter management class, multi-dimensional verification of ad tracking testing is achieved, solving the problems of fragmented parameter extraction and missed testing in existing technologies, and improving testing efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SOHU NEW MEDIA INFORMATION TECH
- Filing Date
- 2026-03-19
- Publication Date
- 2026-07-07
Smart Images

Figure CN121880218B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing technology, and in particular to an advertising tracking testing method and related apparatus. Background Technology
[0002] Ad inventory statistics are a core component of mobile advertising operations. Their accuracy directly determines the efficiency of ad resource allocation and revenue scale. Ad inventory statistics rely on ad tracking data, which needs to be used to confirm which ad placements have impressions or clicks, and to confirm the frequency of ad impressions or clicks, in order to calculate available resources. If the tracking data malfunctions in the production environment, such as an ad placement not being reported or missing parameters, it can lead to undercounting or misjudging of inventory, resulting in idle high-quality resources or reduced resource utilization.
[0003] To avoid the aforementioned problems, the industry generally conducts event tracking tests before or within 24 hours of mobile application release to detect anomalies in advance. For example, sample parameters and ad placement IDs are stored in a CSV file, a binary value set is generated, and then converted into a JSON file as test rules. During testing, event tracking requests are intercepted and parameters are parsed, and the consistency of parameters and value standards are compared to generate ad tracking verification results. However, this ad tracking testing method results in fragmented parameter extraction, requiring modification of multiple scripts when the source of the ad placement ID changes, and is prone to missing ad placements. Summary of the Invention
[0004] In view of the above problems, this application provides an advertising tracking testing method and related apparatus. The specific solution is as follows:
[0005] The first aspect of this application provides an advertising tracking testing method, including:
[0006] Upon receiving a data tracking request, the unified data tracking request processing function is invoked to obtain the core data set of the data tracking request based on the reporting type of the data tracking request.
[0007] Call the custom ad reporting parameter management class to extract the ad tracking core identifier set from the tracking request core data set;
[0008] Based on the reporting type, the application identifier in the core data set of the tracking request, and the operating system type in the core identifier set of the advertising tracking point, the target verification rule corresponding to the tracking point request is determined.
[0009] Based on the target verification rules, multi-dimensional verification is performed on the core data set of the tracking point request.
[0010] In one possible implementation, the unified processing function for the event tracking request retrieves the core data set of the event tracking request based on the reporting type of the event tracking request, including:
[0011] The first sub-function of the unified processing function for the data tracking request is called to extract the URL of the data tracking request;
[0012] The second sub-function of the unified processing function for the data tracking request is called to parse the URL of the data tracking request and obtain the reporting type of the data tracking request.
[0013] If the reporting type of the event tracking request is a GET request, then the core data set of the event tracking request is extracted from the event tracking request, and the core data set of the event tracking request is converted into a structured dictionary of actual reporting parameters.
[0014] If the reporting type of the event tracking request is a POST request, then the request body of the event tracking request is parsed to obtain the core data set of the event tracking request, and the core data set of the event tracking request is transformed into a structured batch reporting data set.
[0015] In one possible implementation, the invocation of a custom ad reporting parameter management class extracts the ad tracking core identifier set from the tracking request core data set, including:
[0016] Call the ad slot extraction method of the ad reporting parameter management class to extract the ad slot identifier from the core data set of the tracking request;
[0017] Call the operating system extraction method of the advertising reporting parameter management class to extract the operating system type from the core data set of the tracking point request;
[0018] Call the advertising business scenario extraction method of the advertising reporting parameter management class to extract the advertising business scenario from the core data set of the tracking point request;
[0019] Call the ad template extraction method of the ad reporting parameter management class to extract the ad template type from the core data set of the tracking point request;
[0020] The advertising status is extracted from the core data set of the tracking point request by calling the advertising status extraction method of the advertising reporting parameter management class.
[0021] In one possible implementation, the ad tracking testing method further includes:
[0022] Create an Excel-formatted verification rule table based on the combination of the application identifier, the operating system type, and the reporting type;
[0023] In each of the aforementioned verification rule tables, create a worksheet corresponding to the ad placement identifier;
[0024] Write the corresponding parameter type and the value range of each parameter type into each worksheet of each of the verification rule tables.
[0025] In one possible implementation, the step of performing multi-dimensional verification on the core data set of the tracking request based on the target verification rules includes:
[0026] Based on all the verification parameter types in the target verification rules, parameter existence verification, parameter redundancy verification, and parameter sorting are performed sequentially on the core data set of the tracking point request to obtain the parameter sequence.
[0027] Determine whether the parameter sequence contains nested parameters;
[0028] If the parameter sequence contains the nested parameters, a parsing request carrying the nested parameters is sent to the nested parameter parsing server, and the received parsing fields are written into the parameter sequence.
[0029] Perform a parameter value validity check on the parameter sequence to obtain the parameters with correct values and the parameters with incorrect values;
[0030] Based on the important parameter types and special parameter types in the target verification rules, extract the important parameters and special parameters from the core data set of the tracking request.
[0031] In one possible implementation, after performing multi-dimensional verification on the core data set of the event tracking request based on the target verification rules, the advertising event tracking testing method further includes:
[0032] Obtain multi-dimensional verification results;
[0033] A verification report is generated based on the multi-dimensional verification results and the preset verification report template;
[0034] Write the URL of the verification report to the log file.
[0035] In one possible implementation, obtaining the multi-dimensional verification result includes:
[0036] If the reporting type is batch reporting of user behavior, then the multi-dimensional verification results are classified and statistically analyzed according to the advertising business scenario.
[0037] A second aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the advertising tracking test method described in the first aspect or any implementation thereof.
[0038] A third aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0039] The memory is used to store computer programs;
[0040] The processor is used to execute the computer program so that the electronic device can implement the advertising tracking test method of the first aspect or any implementation thereof.
[0041] A fourth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to perform the advertising tracking test method described in the first aspect or any implementation thereof.
[0042] By utilizing the above technical solution, this application provides an advertising tracking testing method. Upon receiving a tracking request, it calls a unified processing function to obtain the core data set of the tracking request based on the reporting type. It then calls a custom advertising reporting parameter management class to extract the core advertising tracking identifier set from the core data set. The advertising tracking test script only needs to call one class method to uniformly extract the core advertising tracking identifiers. This eliminates the need to modify multiple scripts when the parameter source changes, solving the problem of fragmented parameter extraction and ensuring that all ad placements can be effectively tested, avoiding unreported ads after deployment. Based on the reporting type, the application identifier in the core data set, and the operating system type in the core advertising tracking identifier set, the target verification rules corresponding to the tracking request are determined. Based on these target verification rules, multi-dimensional verification is performed on the core data set, improving the completeness of the tracking testing method. Attached Figure Description
[0043] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0044] Figure 1 A flowchart illustrating an advertising tracking testing method provided in this application embodiment;
[0045] Figure 2 A schematic diagram illustrating the correspondence between event values and advertising business scenarios provided in the embodiments of this application;
[0046] Figure 3 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation
[0047] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0048] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0049] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0050] For the sake of clarity and reference, the technical terms, abbreviations, or acronyms used below are summarized as follows:
[0051] Ad tracking: refers to the technical means of embedding code in the interactive process related to mobile application advertising (such as loading, exposure, click) to collect advertising event data (such as parameters, timestamps). The original implementation was based on PHP development.
[0052] viewmonitor: Nested parameters, in the format of "key-value pair | key-value pair" (e.g., tt2=16789|scene=splash), require splitting and validating the sub-parameter format and value.
[0053] Event types: v (load), av (exposure), c (click), which are the core event identifiers for ad tracking and determine the matching logic of subsequent validation rules.
[0054] Ad templates: These refer to parameter configuration templates for different ad formats (such as splash screen, news feed, and banner). Different templates require customized validation logic.
[0055] Dynamic rule table: In this invention, the configuration carrier that replaces the binary value set uses an Excel format to define verification rules according to a four-dimensional structure of "ad slot - reporting type - parameter type - value standard", and supports real-time editing and application.
[0056] The AdReportManager class is the core module in this invention that encapsulates the parameter extraction logic. It uniformly extracts the ad slot ID from itemspaceid / apid and the operating system from os / sv, thus solving the fragmentation problem of parameter extraction in existing technologies.
[0057] uevent events: User behavior tracking events (e.g., uevent=7 represents an APP cold start). Existing technologies do not cover the verification of such events. This invention adds batch verification and statistical functions.
[0058] Testing and verification: The core application scenario of this invention refers to the systematic check of ad tracking points within 24 hours before / after the release of a mobile application. The purpose is to detect tracking point anomalies in advance (such as ad slots not being reported or missing parameters) and prevent abnormal data from flowing into the production environment and affecting inventory statistics, rather than directly participating in production environment inventory control.
[0059] This application provides an advertising tracking testing method. The advertising tracking testing method of this application embodiment will be described in detail below with reference to the accompanying drawings.
[0060] Reference Figure 1 , Figure 1 This is a flowchart illustrating an advertising tracking testing method provided in an embodiment of this application, as shown below. Figure 1 As shown in the embodiment of this application, an advertising tracking test method may include steps 101 to 104, which are described in detail below.
[0061] 101: Upon receiving a data tracking request, the unified data tracking request processing function is invoked to obtain the core data set of the data tracking request based on the reporting type of the data tracking request.
[0062] The routing module of the Python web application development framework receives the data tracking requests forwarded by the packet capture tool.
[0063] Python web application development frameworks can include Django, Flask, etc. The core functions are to receive HTTP requests, implement route distribution, process business logic, and return structured responses.
[0064] Packet capture tools such as Charles and Fiddler can be used to capture ad tracking requests sent by the app to the server during a preset testing period (such as 24 hours) before or after the release of a mobile application, such as tracking requests for events like loading, exposure, and clicks, and obtain raw data such as the URL and parameters of the tracking requests.
[0065] By configuring the routing in the Python web application development framework, all ad tracking requests are uniformly distributed to `views.count` (a unified handling function for tracking requests), implementing a single entry point for receiving and processing logic that adapts to all request types. Specifically, by parsing the URL of the tracking request, the reporting type of the tracking request is determined, and then the core data set of the tracking request is obtained based on the reporting type. The core data set of the tracking request includes: application identifier, ad placement identifier, operating system type, etc.
[0066] For example, the routing configuration is as follows:
[0067] from django.urls import path;
[0068] from CheckParams import views;
[0069] urlpatterns = [
[0070] # Regular reporting path mapping
[0071] path('count / v', views.count), # Ad loading and reporting (v) → Matching to the unified processing function
[0072] path('count / av', views.count), # Ad impression reporting (av) → Matching to unified processing function
[0073] path('count / c', views.count), # Ad click reporting (c) → Matching to unified processing function
[0074] # Event tracking and reporting path mapping
[0075] path('count / et', views.count), # Ad-specific event reporting (et) → Matching to the unified processing function
[0076] # User Behavior Batch Reporting Path Mapping
[0077] path('count / uet', views.count), # Batch reporting of user behavior (uet) → Matching to a unified processing function
[0078] # All other tracking paths should be expanded using this format.
[0079] ].
[0080] In one possible implementation, step 101 includes the following steps 1011-1014:
[0081] 1011: Call the first sub-function of the unified processing function for event tracking requests to extract the URL of the event tracking request;
[0082] For example, views.count calls request.build_absolute_uri() (the method for constructing the absolute URL of a request, i.e., the first sub-function mentioned above) to extract the URL of the tracking request. request.build_absolute_uri() is a built-in method of the request object in the Python web application development framework. The core function of this method is to automatically construct the complete absolute URL of the current tracking request, such as https: / / t.ads.sohu.com / count / et?itemspaceid=12451&os=iOS, which includes the protocol (http / https), domain name, port, request path, and query parameters. There is no need to manually construct each part, ensuring the integrity and accuracy of the URL.
[0083] 1012: Call the second sub-function of the unified processing function for event tracking requests to parse the URL of the event tracking request and obtain the request type of the event tracking request;
[0084] For example, views.count calls the get_report_type function (the second sub-function), which extracts the report type from the original URL of the tracking request through string splitting, specifically including:
[0085] First split (split count / ): Use split('count / ')[1] to extract the part after count / in the URL and get a string containing the reporting type and subsequent parameters (such as the above URL after splitting is et?itemspaceid=12451&os=iOS);
[0086] Second split (split?): Use split('?')[0] to extract the part before '?' in the result of the first split, and get the pure reporting type identifier (such as et after splitting the above string);
[0087] Return result: The extracted string is returned as the reporting type (real_report_type).
[0088] Among them, if the reporting type is v (ad loading), av (ad exposure), c (ad click), or et (ad-specific tracking event), it belongs to GET request (regular reporting); if the reporting type is uet (batch reporting of user behavior), it belongs to POST request (batch reporting).
[0089] 1013: If the reporting type of the event tracking request is a GET request, then extract the event tracking request core data set from the event tracking request and convert the event tracking request core data set into a structured dictionary of actual reporting parameters.
[0090] For example, calling the request.GET object automatically parses the query parameters after the question mark in the URL (such as {'itemspaceid':'12451','os':'iOS'}), obtaining the core data set of the event tracking request. By converting the core data set of the event tracking request into a dictionary, the structured data real_report_params (the actual report parameter dictionary) is obtained.
[0091] Here is an example of real_report_params:
[0092] {
[0093] 'itemspaceid': '12451',
[0094] 'os': 'iOS',
[0095] 'viewmonitor': 'tt2=1678901234567|scene=feed'
[0096] }
[0097] 1014: If the reporting type of the tracking request is a POST request, then parse the request body of the tracking request to obtain the core data set of the tracking request, and transform the core data set of the tracking request into a structured batch reporting data set.
[0098] For example, the batch data of the uet in the POST request is stored in the request body (request.body) as a UTF-8 encoded string. The core data set of the tracking request is obtained by decoding the string, and its JSON is deserialized into a processable dictionary data form uet_real_report_data (batch reporting data set).
[0099] The following is an example of uet_real_report_data:
[0100] {
[0101] "data_list": [
[0102] {"uevent": "7", "timetag": "1756105177327", "launch_id": "897654"},
[0103] {"uevent": "12", "timetag": "1756105199567"} ]
[0105] }
[0106] 102: Call the custom ad reporting parameter management class to extract the ad tracking core identifier set from the tracking request core data set.
[0107] The ad reporting parameter management class (adReportManager class) encapsulates the core identifier extraction logic for ad tracking points. By passing real_report_params or uet_event_dict to the adReportManager class, the ad slot ID is uniformly extracted from itemspaceid or apid, and the operating system is extracted from os or sv. Only one class method needs to be called in the test script. When the parameter source changes, there is no need to modify multiple scripts, ensuring that all ad slots can be effectively tested and avoiding failure to report after deployment.
[0108] In one possible implementation, step 102 includes steps 1021-1025:
[0109] 1021: Call the ad slot extraction method of the ad reporting parameter management class to extract the ad slot identifier from the core data set of the tracking request.
[0110] Call adReportManager.get_report_itemspaceid() (ad space extraction method), first retrieve the value from itemspaceid (main ad space identifier), if it is not found, then retrieve apid (alternate ad space identifier), if neither is found, then return None (corresponding to the "Unable to obtain ad space ID" error in the example).
[0111] 1022: Call the operating system extraction method of the advertising reporting parameter management class to extract the operating system type from the core data set of the tracking request.
[0112] Call adReportManager.get_report_ad_os() (custom class method: operating system extraction method) to retrieve the value from os (operating system). If it is not found, split it into sv (system version information, such as sv=iOS 7.4.2 to get iOS). If neither os nor sv is found, return None.
[0113] 1023: Call the advertising business scenario extraction method of the advertising reporting parameter management class to extract the advertising business scenario from the core data set of the tracking request.
[0114] The `adReportManager.get_report_event_value()` method (a custom class method for extracting advertising business scenarios) is called to retrieve the value (e.g., 31) from the `event` parameter. This value is used to match the `et` event rules; different `event` values correspond to different advertising business scenarios. For example, the correspondence between `event` values and advertising business scenarios is as follows: Figure 2 As shown.
[0115] 1024: Call the ad template extraction method of the ad reporting parameter management class to extract the ad template type from the core data set of the tracking request.
[0116] Call adReportManager.get_report_template() (custom class method: ad template extraction method) to get the ad template type ad_template (such as "video template").
[0117] The `analytic_params` function is called. When `ad_template` is empty, non-core parameters such as `monitorkey` and `vrpttype` are automatically removed and a `status` parameter is added (in the code, `remove_params = ['monitorkey','vrpttype','mkey','adstyle']`). This function only executes in empty ad scenarios, which is "unsuitable for any scenario" compared to existing technologies. This improves scenario coverage by 50% and solves the problem of inaccurate tracking for new businesses.
[0118] 1025: Call the ad status extraction method of the ad reporting parameter management class to extract the ad status from the core data set of the tracking request.
[0119] Call adReportManager.get_report_ad_status() (custom class method: ad status extraction method) to determine whether the ad status is an empty ad or a non-empty ad (if ad_type=empty, mark it as "empty ad").
[0120] Finally, a set of core identifiers for ad tracking is generated, which includes: ad_itemspace_id (ad space identifier), ad_os (operating system type), ad_event_value (ad business scenario), ad_template (ad template type), ad_type (ad status), and other core identifiers.
[0121] 103: Determine the target verification rules corresponding to the event tracking request based on the reporting type, the application identifier in the core data set of the event tracking request, and the operating system type in the core identifier set of the advertising event tracking.
[0122] For example, the get_report_excel function is called, passing in ad_os (operating system type, such as iOS), real_report_type (reporting type, such as v / et), and ad_appid (application identifier, such as news). The storage path of the target validation rule is determined based on the passed ad_appid+ad_os+report_type, and the target validation rule is read from the storage path of the target validation rule. The storage path of the validation rule corresponding to different combinations of ad_appid+ad_os+report_type is pre-configured.
[0123] The target validation rules are stored in an Excel file. A custom function, `get_params_config_from_excel`, is called to load the configuration from the corresponding `worksheet_name` (e.g., `ad_os=iOS / ad_itemspace_id=12451`) in the target validation rules Excel file based on the ad slot identifier.
[0124] all_report_params: All validation parameters (e.g., ['itemspaceid', 'os', 'news_num']);
[0125] important_params: Important parameters (e.g., ['appchn', 'appid', 'cid']);
[0126] special_params: Special parameters (such as ['appdelaytrack', 'delaytrack']).
[0127] If the target validation rule table does not exist or the configuration is missing, an error message is returned (such as "Parameter configuration for ad slot 12451 not found"); if the target validation rule exists, all_report_params / important_params / special_params are passed to the next step.
[0128] In one possible implementation, the method for configuring the validation rules corresponding to different combinations of ad_appid+ad_os+report_type includes: creating a validation rule table in Excel format based on the combination of ad_appid+ad_os+report_type; creating a worksheet corresponding to the ad slot identifier in each validation rule table; and writing the corresponding parameter type and the value range of each parameter type into each worksheet in each validation rule table, namely the value range of all_report_params, the value range of important_params, and the value range of special_params.
[0129] This embodiment uses a three-dimensional Excel validation rule table, eliminating the need for format conversion when updating rules (e.g., modifying the appchn value standard only requires editing the Excel cell). Compared to the existing technology's process of "JSON configuration requiring the regeneration of a binary set," the update efficiency is improved by more than 90%, solving the problem of slow rule iteration.
[0130] 104: Based on the target verification rules, perform multi-dimensional verification on the core data set of the tracking request and the core identifier set of the advertising tracking.
[0131] For example, a custom function, compare_params, is called, passing in real_report_type, ad_itemspace_id, ad_template, all_report_params, real_report_params, important_params, and special_params to perform multi-dimensional validation.
[0132] In one possible implementation, multi-dimensional verification includes the following steps 1041-1045:
[0133] 1041: Based on all the verification parameter types in the target verification rules, perform parameter existence verification, parameter redundancy verification, and parameter sorting sequentially on the core data set of the tracking request to obtain the parameter sequence.
[0134] Calling the following existence check function to perform a parameter existence check returns the missing parameter:
[0135] required_params_missing = list(set(all_report_params) - set(real_report_params.keys())).
[0136] Call the following redundancy check function to perform parameter redundancy check, converting the newly added parameter into a dictionary, such as the returned "new parameter {ad_button_status:1}" in the example:
[0137] extra_params_key = list(set(real_report_params.keys()) - set(all_report_params)).
[0138] The following sorting function is called to sort the parameters alphabetically, resulting in the parameter sequence passed_params_sorted:
[0139] passed_params = {k:v for k,v in real_report_params.items() if k inall_report_params}.
[0140] 1042: Determine if a parameter sequence contains nested parameters.
[0141] Determine if the parameter sequence passed_params_sorted contains viewmonitor. If it does, then the parameter sequence contains nested parameters.
[0142] 1043: If the parameter sequence contains nested parameters, send a parsing request carrying the nested parameters to the nested parameter parsing server, and write the received parsed fields into the parameter sequence.
[0143] If the viewmonitor calls the custom function parse_viewmonitor (code file parse_viewmonitor.py) in passed_params_sorted, it sends a parsing request (POST request) with nested parameters to the parameter parsing server.
[0144] The parameter parsing server relies on a general function (requests.post, a Python third-party library) to parse nested values, such as "e=f / / 7eUf2KB5RNg..." → "aid=200159764|campid=20860878|...", and converts them into "key=value| key=value" format and stores them in passed_params_sorted.
[0145] By using the `parse_viewmonitor` function to automate the parsing of nested parameters, the error rate is reduced from 15% to 0.5% compared to the existing "manual splitting" technology. At the same time, by combining the `check_report_params_value` function to verify the validity of the values, the abnormal data interception rate is improved by 60%, solving the problem of low verification accuracy.
[0146] 1044: Perform a parameter value validity check on the parameter sequence to obtain the parameters with correct values and the parameters with incorrect values.
[0147] Call the custom validity check function check_report_params_value, which is based on the expected_values dictionary (the expected values of each parameter are defined in the code, such as appchn being a 4-digit number and os being iOS / Android / Harmony), to get the correct parameter right_values and the incorrect parameter wrong_values (if there is none, it means "no abnormal value").
[0148] 1045: Based on the important and special parameter types in the target verification rules, extract the important and special parameters from the core data set of the tracking request.
[0149] The following important parameter validation functions are called to extract important parameters from the core data set of the tracking request:
[0150] import_passed_params = {p:real_report_params.get(p,'Important parameter missing')for p in important_params}.
[0151] The same applies to the special parameter type special_passed_params, so I won't go into details.
[0152] The results of the multi-dimensional validation are as follows:
[0153] required_params_missing, extra_params, passed_params_sorted, import_passed_params, special_passed_params, right_values, wrong_values.
[0154] It should be noted that if the reporting type of the event tracking request is uet, i.e., a POST request, the data_list in the request body is obtained, the data_list is traversed, and the event is categorized by uevent value (e.g., 7 / 8). The custom function get_report_event_name is then called to retrieve the event name (e.g., "APP Startup - Cold Start") and the reporting time from ad_uet.txt.
[0155] Batch validation: For each uevent type, call the custom function compare_uet_params (similar to compare_params, supporting batch data) to count the "total number of reports", "number of passes", and "number of failures";
[0156] Result generation: Generate "The following are the verification results of this uevent report" (including statistical information) and "Details of the verification of each uevent event" (corresponding to the uet_real_report_summary dictionary);
[0157] Results and flow: Concatenate uet_check_result with the default return (message:success) and return it via JsonResponse.
[0158] Furthermore, after obtaining the multi-dimensional verification results, a verification report can be generated based on the multi-dimensional verification results and the preset verification report template.
[0159] For example, call the custom function check_report_result_details, pass in the above multi-dimensional verification results, and in the default verification report template, [Verification Result] = [Success], if there are missing / redundant / value errors, update to "[Failure]", and concatenate the error reason (such as "[1] Parameter missing [2] Redundant parameter exists!").
[0160] Specifically:
[0161] Missing parameters: Add "Missing parameters: field1, field2";
[0162] Redundant parameters: Add "New parameter {field: value}";
[0163] Special / Important Parameters: Add corresponding modules (e.g., "[Special Parameters] Display") and parameter dictionaries;
[0164] Value validation results: Add "[Validation passed]" and "[Validation failed]" fields;
[0165] Event title generation: Call the custom function get_report_title and concatenate "This verification report content: iOS--12451-- Feed Ad-Video Template-Report Type".
[0166] In this embodiment, the check_report_result_details function generates structured results containing the reasons for errors. Compared with the existing technology that "only outputs pass / fail", the problem location time is reduced from 1 hour to 5 minutes, solving the problem of ambiguous feedback.
[0167] Furthermore, the URL of the verification report can be written to a log file for later viewing.
[0168] The following is a detailed description of the advertising tracking testing method provided in this application embodiment through a specific example:
[0169] Taking "iOS system feed ad (ad ID: 12451) loading event (v event) tracking verification" as an example, the scenario background is "for mobile application pre-release testing, it is necessary to verify whether the loading event tracking of the ad slot complies with the rules to avoid missing parameters / incorrect values flowing into the production environment".
[0170] The URL of the input event request (obtained by Charles packet capture):
[0171] https: / / t.ads.sohu.com / count / v?itemspaceid=12451&os=iOS&appid=news&viewmonitor=tt2=1678901234567|scene=feed&ad_button_status=1;
[0172] Excel validation rule table configuration (worksheet "12451" in iOS_Report__Params.xlsx):
[0173] All validation parameter types for the "v event" are: itemspaceid, os, appid, viewmonitor, and news_num;
[0174] Important parameter types for “v event”: appid (expected value: news / hy), cid (expected value: 19-digit number);
[0175] Special parameter type for “v event”: None.
[0176] The verification process includes the following steps 1-5:
[0177] Step 1 (URL Routing): Django's route matching function `count` calls `get_report_type` to parse the reported type as "v", and extracts:
[0178] real_report_params= {"itemspaceid":"12451","os":"iOS","appid":"news","viewmonitor":"tt2=1678901234567|scene=feed","ad_button_status":"1"};
[0179] Step 2 (Parameter Extraction): Initialize AdReportManager, call get_report_itemspaceid() to get the ad space ID "12451", get_report_ad_os() to extract the operating system "iOS", and get_report_ad_status() to determine that it is a "non-empty ad";
[0180] Step 3 (Rule Matching): Call get_report_excel to locate the Excel file with the path iOS_Report__Params.xlsx, and call get_params_config_from_excel to read the "12451-v" configuration, returning the required parameters [itemspaceid, os, appid, viewmonitor, news_num] and the important parameters [appid, cid].
[0181] Step 4 (Multi-dimensional verification):
[0182] compare_params calculates the missing parameter [news_num] and the redundant parameter {"ad_button_status":"1"};
[0183] The `parse_viewmonitor` function is called to parse the viewmonitor as "tt2=1678901234567|scene=feed" (verification that tt2 is a 13-digit timestamp is successful).
[0184] The check_report_params_value verification shows that appid=news is as expected, but cid is missing (marked as "Important parameter missing").
[0185] Step 5 (Result Generation):
[0186] check_report_result_details generates structured results;
[0187] log_check_result records the original URL and the result to a log file;
[0188] The result is returned to the tester via JsonResponse.
[0189] In this scenario, the validation of a single ad slot's v event is completed in just seconds, improving efficiency by 90% compared to existing technologies (manual splitting + modification of multiple scripts). The error rate is reduced from 15% to 0.5%. Testers can directly locate "supplementing the news_num parameter, deleting the ad_button_status parameter, and checking the cid tracking point" to prevent abnormal data from flowing into the production environment.
[0190] This application also provides an electronic device in its embodiments. (See reference...) Figure 3 As shown, it illustrates a structural schematic diagram suitable for implementing the electronic device in the embodiments of this application. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0191] like Figure 3 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. When the electronic device is powered on, the RAM 303 also stores various programs and data required for the operation of the electronic device. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0192] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, memory cards, hard drives, etc.; and communication devices 309. Communication device 309 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0193] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the advertising tracking testing methods provided in this application.
[0194] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the advertising tracking test methods provided in this application.
[0195] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0196] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0197] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0198] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A method for testing ad placement points, characterized in that, include: Upon receiving a data tracking request, the unified data tracking request processing function is invoked to obtain the core data set of the data tracking request based on the reporting type of the data tracking request. Call the custom ad reporting parameter management class to extract the ad tracking core identifier set from the tracking request core data set; Based on the reporting type, the application identifier in the core data set of the tracking request, and the operating system type in the core identifier set of the advertising tracking point, the target verification rule corresponding to the tracking point request is determined. Based on the target verification rules, multi-dimensional verification is performed on the core data set of the tracking point request; The unified processing function for data tracking requests retrieves the core data set of the data tracking request based on the reporting type of the data tracking request, including: The first sub-function of the unified processing function for the data tracking request is called to extract the URL of the data tracking request; The second sub-function of the unified processing function for the data tracking request is called to parse the URL of the data tracking request and obtain the reporting type of the data tracking request. If the reporting type of the event tracking request is a GET request, then the core data set of the event tracking request is extracted from the event tracking request, and the core data set of the event tracking request is converted into a structured dictionary of actual reporting parameters. If the reporting type of the event tracking request is a POST request, then the request body of the event tracking request is parsed to obtain the core data set of the event tracking request, and the core data set of the event tracking request is transformed into a structured batch reporting data set.
2. The advertising tracking method according to claim 1, characterized in that, The method of calling the custom ad reporting parameter management class extracts the ad tracking core identifier set from the tracking request core data set, including: Call the ad slot extraction method of the ad reporting parameter management class to extract the ad slot identifier from the core data set of the tracking request; Call the operating system extraction method of the advertising reporting parameter management class to extract the operating system type from the core data set of the tracking point request; Call the advertising business scenario extraction method of the advertising reporting parameter management class to extract the advertising business scenario from the core data set of the tracking point request; Call the ad template extraction method of the ad reporting parameter management class to extract the ad template type from the core data set of the tracking point request; The advertising status is extracted from the core data set of the tracking point request by calling the advertising status extraction method of the advertising reporting parameter management class.
3. The advertising tracking method according to claim 1, characterized in that, The advertising tracking testing method also includes: Create an Excel-formatted verification rule table based on the combination of the application identifier, the operating system type, and the reporting type; In each of the aforementioned verification rule tables, create a worksheet corresponding to the ad placement identifier; Write the corresponding parameter type and the value range of each parameter type into each worksheet of each of the verification rule tables.
4. The advertising tracking method according to claim 1, characterized in that, The multi-dimensional verification of the core data set of the tracking request based on the target verification rules includes: Based on all the verification parameter types in the target verification rules, parameter existence verification, parameter redundancy verification, and parameter sorting are performed sequentially on the core data set of the tracking point request to obtain the parameter sequence. Determine whether the parameter sequence contains nested parameters; If the parameter sequence contains the nested parameters, a parsing request carrying the nested parameters is sent to the nested parameter parsing server, and the received parsing fields are written into the parameter sequence. Perform a parameter value validity check on the parameter sequence to obtain the parameters with correct values and the parameters with incorrect values; Based on the important parameter types and special parameter types in the target verification rules, extract the important parameters and special parameters from the core data set of the tracking request.
5. The advertising tracking method according to claim 1 or 4, characterized in that, After performing multi-dimensional verification on the core data set of the event tracking request based on the target verification rules, the advertising event tracking testing method further includes: Obtain multi-dimensional verification results; A verification report is generated based on the multi-dimensional verification results and the preset verification report template; Write the URL of the verification report to the log file.
6. The advertising tracking method according to claim 5, characterized in that, The process of obtaining multi-dimensional verification results includes: If the reporting type is batch reporting of user behavior, then the multi-dimensional verification results are classified and statistically analyzed according to the advertising business scenario.
7. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the advertising tracking test method as described in any one of claims 1 to 6.
8. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the advertising tracking test method as described in any one of claims 1 to 6.
9. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the advertising tracking test method as described in any one of claims 1 to 6.