Method, apparatus and related medium for obtaining reports based on Google Ads API

Through Google's permission checksum data integration, a merge report is generated, which solves the problem that Google's backend can only obtain data from a single sub-account, and improves corporate advertising delivery efficiency and data analysis capabilities.

CN116248734BActive Publication Date: 2025-07-22AFIRSTSOFT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310223477.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-09
Publication Date
2025-07-22
Estimated Expiration
2043-03-09

AI Technical Summary

Technical Problem

In the prior art, Google backend can only obtain single sub-account data and cannot be associated with business data, resulting in the inability to maximize the advertising delivery effect.

Method used

Through Google permission verification, Google configuration files are built and the client is initialized, Google advertising and business data is obtained, data cleaning and merging is performed, sub-account reports are generated, and data merging and compression is performed, and finally a merge report is generated and uploaded to the cluster for backup.

Benefits of technology

It has achieved improvements in corporate advertising efficiency, and by integrating Google advertising and business data, it provides more comprehensive advertising delivery performance analysis and visual display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116248734B_ABST
    Figure CN116248734B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, apparatus and related medium for obtaining reports based on the Google Ads API. The method includes: performing Google permission verification to obtain a Google permission verification file; constructing a Google configuration file and performing initialization configuration on the Google configuration file to obtain a Google client; using the Google client to obtain Google ads and business data respectively, and performing data cleaning on the Google ads and the business data respectively, merging the Google ads and the business data to obtain at least one sub-account report; performing data merging processing on the sub-account report to obtain a merged report; performing data compression processing on the merged report to obtain a final report, and uploading the final report to the cluster for backup. The present invention obtains the sub-account report through the Google client and integrates it to obtain the final report. In this way, the efficiency of enterprise advertising placement is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data transmission technology, and in particular to a report acquisition method and device based on Google Ads API and related media. Background Art

[0002] With the development of information globalization, many companies need to promote their products overseas. If they want their products to be known by users around the world, they need to rely on Google for advertising promotion. Google will place advertisements based on the keywords, geographic location and Google-related products placed by the company, thereby attracting users to purchase products.

[0003] However, Google's own backend can only obtain data from a single sub-account and cannot associate it with business data; therefore, to a certain extent, it is impossible for companies to maximize the efficiency of advertising; currently some open source platforms (such as Github, etc.) do not have corresponding solutions. Summary of the invention

[0004] The embodiments of the present invention provide a report acquisition method and device based on the Google Ads API and related media, aiming to solve the problem in the prior art that the Google backend can only obtain data of a single sub-account and cannot be associated with business data.

[0005] In a first aspect, an embodiment of the present invention provides a report acquisition method based on the Google Ads API, comprising:

[0006] Perform Google permission verification to obtain a Google permission verification file; wherein the Google permission verification includes verification of the Google backend and application of the developer platform; the Google permission verification file includes an access token and a refresh token;

[0007] Constructing a Google configuration file according to the Google permission verification file, and initializing the configuration file to obtain a Google client;

[0008] Using the Google client to obtain Google ads and business data respectively, and performing data cleansing on the Google ads and the business data respectively, and merging the Google ads and the business data to obtain at least one sub-account report;

[0009] Performing data merging processing on the sub-account reports to obtain a merged report; wherein the data merging processing includes field renaming, field separator setting, character encoding setting, and canceling the header;

[0010] The combined report is subjected to data compression processing to obtain a final report, and the final report is uploaded to the cluster for standby; wherein the final report is used for indicator calculation and visual display.

[0011] In a second aspect, an embodiment of the present invention provides a report acquisition device based on the Google Ads API, including:

[0012] A Google verification unit for performing Google permission verification to obtain a Google permission verification file; wherein, the Google permission verification includes verification on the Google backend and application on the developer platform; the Google permission verification file includes an access token and a refresh token;

[0013] A Google initialization unit for constructing a Google configuration file according to the Google permission verification file and performing initialization configuration on the Google configuration file to obtain a Google client;

[0014] A Google acquisition unit for respectively acquiring Google ads and business data by using the Google client, respectively performing data cleaning on the Google ads and the business data, and merging the Google ads and the business data to obtain at least one sub-account report;

[0015] A Google merging unit for performing data merging processing on the sub-account report to obtain a merged report; wherein, the data merging processing includes field renaming, field delimiter setting, character encoding setting, and removing the table header;

[0016] A Google uploading unit for performing data compression processing on the merged report to obtain a final report, and uploading the final report to the cluster for backup; wherein, the final report is used for metric calculation and visual display.

[0017] In a third aspect, an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, it implements the report acquisition method based on the Google Ads API in the first aspect.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the report acquisition method based on the Google Ads API in the first aspect.

[0019] An embodiment of the present invention provides a method for obtaining reports based on the Google Ads API, including: performing Google permission verification to obtain a Google permission verification file; constructing a Google configuration file and performing initialization configuration on the Google configuration file to obtain a Google client; using the Google client to obtain Google ads and business data respectively, and performing data cleaning on the Google ads and the business data respectively, merging the Google ads and the business data to obtain at least one sub-account report; performing data merging processing on the sub-account report to obtain a merged report; performing data compression processing on the merged report to obtain a final report, and uploading the final report to the cluster for backup. The present invention obtains the sub-account report through the Google client and integrates it to obtain the final report. In this way, the efficiency of enterprise advertising placement is greatly improved.

[0020] An embodiment of the present invention also provides a device, a computer device, and a storage medium for obtaining reports based on the Google Ads API, which also have the above beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0022] Figure 1 It is a flowchart of a method for obtaining reports based on the Google Ads API provided by an embodiment of the present invention;

[0023] Figure 2 It is a schematic block diagram of a device for obtaining reports based on the Google Ads API provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0025] It should be understood that when used in this specification and the appended claims, the terms "including" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0026] It should also be understood that the terms used in the specification of the present invention herein are for the purpose of describing specific embodiments only and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.

[0027] It should be further understood that the term "and / or" used in the specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0028] Please refer to the following Figure 1 , Figure 1 which is a schematic flow diagram of obtaining a report based on the Google Ads API provided for an embodiment of the present invention, specifically including: steps S101 to S105.

[0029] S101. Perform Google permission verification to obtain a Google permission verification file; wherein, the Google permission verification includes verification by the Google backend and application on the developer platform; the Google permission verification file includes an access token and a refresh token;

[0030] S102. Construct a Google configuration file according to the Google permission verification file, and perform initialization configuration on the Google configuration file to obtain a Google client;

[0031] S103. Use the Google client to obtain Google ads and business data respectively, and perform data cleaning on the Google ads and the business data respectively, and merge the Google ads and the business data to obtain at least one sub-account report;

[0032] S104. Perform data merging processing on the sub-account report to obtain a merged report; wherein, the data merging processing includes field renaming, field delimiter setting, character encoding setting, and removing the table header;

[0033] S105. Perform data compression processing on the merged report to obtain a final report, and upload the final report to the cluster for backup; wherein, the final report is used for metric calculation and visual display.

[0034] In step S101, before calling the Google Ads API to obtain data, Google permission verification needs to be performed. The Google permission verification is divided into two parts: Google backend verification and developer platform application. The Google backend is used for related content such as Google Ads placement and single-account data display. To improve the security of the Google backend data, Google uses the OAuth2.0 protocol for permission verification when providing the backend data API interface, and then applies for API access permission by registering the developer platform to obtain the Google backend data.

[0035] In one embodiment, before the step S101, it includes:

[0036] Download the Google dependency package for Python through the Google Ads API documentation; configure the server domain name for requesting ads, where the server domain name for requesting ads is used as the callback address.

[0037] In this embodiment, it is necessary to first install the dependency environment, first download the Google dependency package for Python through the Google Ads API documentation, and then configure the server domain name for requesting Google Ads, which is used as the callback address when registering the developer platform to apply for the refresh token later. The present invention mainly relies on the Google Ads API documentation to perform related operations of the API, and the Google Ads API documentation can be obtained on the Google official website.

[0038] In one embodiment, the step S101 includes:

[0039] Register the developer platform and enable the Google Ads API call service to create an API call instance; obtain the parameters of the access token and the parameters of the refresh token according to the API call instance; log in to the Google backend, add the Google account registered on the developer platform, and obtain the permission for the Google account to access the Google backend according to the parameters of the access token to obtain the access token; call the refresh token API according to the callback address of the server domain name for requesting ads and the parameters of the refresh token; perform interactive authentication according to the return link of the refresh token API to obtain the refresh token.

[0040] In this embodiment, parameters for obtaining an OAuth access token and an OAuth refresh token for accessing the Google backend are obtained based on the client ID, client secret, and domain name mapped to the local server address generated according to the API call instance. Log in to the Google backend, add the Google account of the developer platform, and add the permission to access the Google backend for the Google account to obtain the access token; according to the callback address of the server domain name for requesting advertisements and the parameters of the refresh token, call the refresh token API provided by Google; finally, perform interactive authentication based on the return link of the refresh token API, and the refresh token can be obtained if the authentication is passed.

[0041] In step S102, a Google configuration file can be constructed based on the Google permission verification file, and then the constructed Google configuration file can be initialized to obtain the Google client.

[0042] In one embodiment, step S102 includes:

[0043] Construct the Google configuration file and perform initialization configuration on the Google configuration file; wherein, the Google configuration file includes parameters in the developer platform and the refresh token; call google.ads.googleads in the Google dependency package according to the Google configuration file to generate the Google client.

[0044] In this embodiment, before calling the Google Ads API to download a report, it is necessary to construct the Google configuration file for generating the Google client. The Google configuration file contains developer_token, client_id, client_secret, login_customer_id in the developer platform, and the refresh token; according to the Google configuration file, call google.ads.googleads in the Google dependency package to generate the Google client.

[0045] In step S103, the Google ads are the advertisement placement data provided by the Google Ads API, and the business data is the relevant data generated by the business (such as order data). Then, the Google ads and the business data are respectively cleaned through the pandas module of python, and finally the Google ads and the business data are merged to obtain at least one sub-account report; generally speaking, there will be multiple sub-account reports because in actual use, there are many users and each user corresponds to one sub-account report.

[0046] In one embodiment, step S103 includes:

[0047] Build a Google report downloader according to the Google Ads API documentation; call the Google report downloader and custom parameters to obtain the Google Ads; wherein, the custom parameters include the start date, end date, and type of the Google Ads; associate the Google Ads with the business data to obtain a business identifier; parse out the business identifier through regular expression matching in Python and store it as field data; use the pandas module in Python to perform data cleaning on the Google Ads and the business data respectively according to the field data, and merge the Google Ads and the business data to obtain at least one sub-account report.

[0048] In this embodiment, build the Google report downloader search_stream according to the Google Ads API documentation, and call the Google report downloader and the custom parameters to obtain the Google report. The Google report is divided into three parts: dimension, metrics, and segments; dimension represents the dimension to be obtained, such as campaign name, campaign status, etc.; metrics represents various indicators generated when placing ads, such as clicks, impressions, cost, etc.; segments represents the range of data to be obtained; in the present invention, the time range for obtaining the Google Ads is mainly controlled by segments.

[0049] Additionally, since there is an attribution model within the Google Ads and the data changes in real time, after a long period of operation (such as about one week), the basic data changes will be very small. Therefore, the data time granularity of the present invention is statistically calculated on a monthly basis, that is, all data from the beginning of the current month to the present is obtained at a fixed time every day, and the date of segments.date is restricted by passing parameters through an external script. Then, the Google Ads and the business data are associated to obtain a business identifier; in the present invention, the data is associated through the core of the advertisement placement - the advertisement series name + the identifier of the business data. When making a call, the business identifier can be parsed out through regular expression matching in Python and stored as a field (i.e., the field data). After obtaining each field data, data cleaning is performed through the pandas module in Python. For example, there are many changes in advertisement placement: deletion and addition of advertisement sub-accounts, advertisement series, etc. Using the pandas module can quickly achieve data cleaning. In the present invention, pandas.empty is used to determine whether the report content is empty. If it is empty, subsequent steps such as data storage will not be performed. When requesting Google metric data, the advertisement cost needs to be divided by 1,000,000 to obtain the accurate advertisement cost, which takes too long. Using the pandas module can improve the calculation efficiency. Finally, the Google Ads and the business data are merged to obtain at least one sub-account report, which is downloaded to local storage for subsequent use.

[0050] In step S104, the sub-account report downloaded to the local is merged through the pandas module to obtain the merged report; wherein, the data merging process includes field renaming, field delimiter setting, character encoding setting, and removing table headers, etc.

[0051] In step S105, the metric calculation is performed offline, and the data warehouse concept of spark + hive (computing engine + data warehouse tool, the same below) is used to implement it; through the obtained Google report, combined with the company's business-related tables, specific metric calculations are carried out. In the present invention, the Google report and the business data are associated through the business identifier. At the same time, Google metrics are obtained, and the sales data is associated through the business identifier. Combining the field data, the sales data is calculated to obtain the sales metrics. After obtaining the Google metrics and the sales metrics respectively, a data transfer tool is used to export the advertisement metrics and sales data in hvie to mysql or other query tool libraries for visual display. Since the metrics include various dimensions, various combinations can be made for advertisement analysis, thus solving the problem of high advertisement placement cost and low conversion rate to a certain extent.

[0052] In one embodiment, step S105 includes:

[0053] The combined report is processed for data compression through Python calling system commands according to the LZO data compression algorithm to obtain an LZO compressed file; wherein, the LZO compressed file is the final report.

[0054] Furthermore, Python is used to create an HDFS client by relying on kerberos.client in the hdfs package; the HDFS link and Kerberos in the HDFS client are verified; wherein, the Kerberos includes a Kerberos key file, SSH authentication, and a hosts whitelist.

[0055] In this embodiment, in order to further reduce the efficiency problem caused by data transmission, LZO is used for data compression in this project because LZO compression supports HDFS slicing and has a high compression efficiency. Python is used to call system commands to compress the combined report into an LZO compressed file (i.e., the final report).

[0056] Furthermore, to transmit data to the HDFS cluster, it is necessary to first use Python to create an HDFS client by relying on kerberos.client in the hdfs package; when creating the HDFS client, HDFS link and related permission authentication (such as Kerberos) are required. The present invention uses Kerberos for data security management. Therefore, when performing Kerberos authentication, a Kerberos key file, SSH authentication, and a hosts whitelist in the big data cluster are required.

[0057] Combined Figure 2 as shown Figure 2 FIG. is a schematic block diagram of a report acquisition device based on the Google Ads API provided by an embodiment of the present invention. The report acquisition device 200 based on the Google Ads API includes:

[0058] A Google verification unit 201, configured to perform Google permission verification to obtain a Google permission verification file; wherein, the Google permission verification includes verification on the Google backend and application on the developer platform; the Google permission verification file includes an access token and a refresh token;

[0059] A Google initialization unit 202, configured to construct a Google configuration file according to the Google permission verification file and perform initialization configuration on the Google configuration file to obtain a Google client;

[0060] A Google acquisition unit 203 is configured to respectively acquire Google ads and business data by using the Google client, perform data cleaning on the Google ads and the business data respectively, and merge the Google ads and the business data to obtain at least one sub-account report;

[0061] A Google merging unit 204 is configured to perform data merging processing on the sub-account report to obtain a merged report; wherein, the data merging processing includes field renaming, field delimiter setting, character encoding setting, and removing the table header;

[0062] A Google uploading unit 205 is configured to perform data compression processing on the merged report to obtain a final report, and upload the final report to the cluster for backup; wherein, the final report is used for metric calculation and visual display.

[0063] In this embodiment, first, a Google verification unit 201 performs Google permission verification to obtain a Google permission verification file; wherein, the Google permission verification includes verification of the Google background and application on the developer platform; the Google permission verification file includes an access token and a refresh token; a Google initial unit 202 constructs a Google configuration file according to the Google permission verification file and performs initialization configuration on the Google configuration file to obtain a Google client; then, the Google acquisition unit 203 respectively acquires Google ads and business data by using the Google client, performs data cleaning on the Google ads and the business data respectively, and merges the Google ads and the business data to obtain at least one sub-account report; the Google merging unit 204 performs data merging processing on the sub-account report to obtain a merged report; wherein, the data merging processing includes field renaming, field delimiter setting, character encoding setting, and removing the table header; finally, the Google uploading unit 205 performs data compression processing on the merged report to obtain a final report, and uploads the final report to the cluster for backup; wherein, the final report is used for metric calculation and visual display.

[0064] In one embodiment, before the Google verification unit, it includes:

[0065] A download unit is configured to download the Google dependency package for Python through the Google Ads API documentation;

[0066] A configuration unit is configured to configure the server domain name for requesting ads; wherein, the server domain name for requesting ads is used as a callback address.

[0067] In one embodiment, the Google verification unit includes:

[0068] A registration unit is configured to register the developer platform and enable the Google Ads API call service to create an API call instance;

[0069] A calling unit, configured to obtain the parameters of the access token and the parameters of the refresh token according to the API call instance;

[0070] A login unit, configured to log in to the Google backend, add and register a Google account of the developer platform, and obtain the permission for the Google account to access the Google backend according to the parameters of the access token, so as to obtain the access token;

[0071] A refresh unit, configured to call the refresh token API according to the callback address of the server domain name for requesting advertisements and the parameters of the refresh token;

[0072] An authentication unit, configured to perform interactive authentication according to the return link of the refresh token API to obtain the refresh token.

[0073] In one embodiment, the Google initialization unit includes:

[0074] A construction unit, configured to construct the Google configuration file and perform initialization configuration on the Google configuration file; wherein, the Google configuration file includes the parameters in the developer platform and the refresh token;

[0075] A generation unit, configured to call google.ads.googleads in the Google dependency package according to the Google configuration file to generate the Google client.

[0076] In one embodiment, the Google acquisition unit includes:

[0077] A document unit, configured to construct a Google report downloader according to the Google Ads API document;

[0078] A parameter unit, configured to call the Google report downloader and custom parameters to obtain the Google advertisements; wherein, the custom parameters include the start date, end date and type of the Google advertisements;

[0079] An association unit, configured to perform data association between the Google advertisements and the business data to obtain a business identifier;

[0080] A parsing unit, configured to parse out the business identifier through Re regular matching in Python and store it as field data;

[0081] A synthesis unit, configured to perform data cleaning on the Google advertisements and the business data respectively by using the pandas module in Python according to the field data, and merge the Google advertisements and the business data to obtain at least one sub-account report.

[0082] In one embodiment, the Google upload unit includes:

[0083] A compression unit, configured to perform data compression processing on the merged report by calling a system command through Python according to the LZO data compression algorithm, to obtain an LZO compressed file; wherein, the LZO compressed file is the final report.

[0084] In an embodiment, the Google upload unit further includes:

[0085] A cluster unit, configured to create an HDFS client by using Python to rely on the kerberos.client in the hdfs package; verify the HDFS link and kerberos in the HDFS client; wherein, the kerberos includes a kerberos key file, an SSH authentication, and a hosts whitelist.

[0086] Since the embodiments of the apparatus part correspond to the embodiments of the method part, for the descriptions of the embodiments of the apparatus part, please refer to the descriptions of the embodiments of the method part, which will not be elaborated here.

[0087] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiments can be implemented. The storage medium may include: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store program codes.

[0088] An embodiment of the present invention further provides a computer device, which may include a memory and a processor. When the processor calls the computer program stored in the memory, the steps provided in the above embodiments can be implemented. Of course, the computer device may further include various network interfaces, power supplies, and other components.

[0089] The embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments may be referred to each other. For the system disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts may be referred to the description in the method part. It should be noted that for those of ordinary skill in the art in the technical field of the present application, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

[0090] It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

Claims

1. A method for obtaining reports based on the Google Ads API, characterized in that, Including: Perform Google permission verification to obtain a Google permission verification file; wherein, the Google permission verification includes verification by the Google backend and application on the developer platform; the Google permission verification file includes an access token and a refresh token; Construct a Google configuration file based on the Google permission verification file, and perform initialization configuration on the Google configuration file to obtain a Google client; Use the Google client to obtain Google ads and business data respectively, and perform data cleaning on the Google ads and the business data respectively, and merge the Google ads and the business data to obtain at least one sub-account report; Perform data merging processing on the sub-account report to obtain a merged report; wherein, the data merging processing includes field renaming, field delimiter setting, character encoding setting, and removing the table header; Perform data compression processing on the merged report to obtain a final report, and upload the final report to the cluster for backup; wherein, the final report is used for metric calculation and visual display.

2. The method for obtaining a report based on the Google Ads API according to claim 1, wherein Before performing the Google permission verification to obtain the Google permission verification file, it includes: Download the Google dependency package for Python through the Google Ads API documentation; Configure the server domain name for requesting ads; wherein, the server domain name for requesting ads is used as a callback address.

3. The method for obtaining a report based on the Google Ads API according to claim 2, wherein The performing Google permission verification to obtain the Google permission verification file includes: Register the developer platform and enable the Google Ads API call service to create an API call instance; Obtain the parameters of the access token and the parameters of the refresh token according to the API call instance; Log in to the Google backend, add the Google account registered on the developer platform, and obtain the permission for the Google account to access the Google backend according to the parameters of the access token to obtain the access token; Call the refresh token API according to the callback address of the server domain name for requesting ads and the parameters of the refresh token; Perform interactive authentication according to the return link of the refresh token API to obtain the refresh token.

4. The method for obtaining a report based on the Google Ads API according to claim 2, wherein The constructing a Google configuration file based on the Google permission verification file and performing initialization configuration on the Google configuration file to obtain a Google client includes: Construct the Google configuration file and perform initialization configuration on the Google configuration file; wherein, the Google configuration file includes the parameters in the developer platform and the refresh token; Call google.ads.googleads in the Google dependency package according to the Google configuration file to generate the Google client.

5. The method for obtaining a report based on the Google Ads API according to claim 1, characterized in that The using the Google client to obtain Google ads and business data respectively, and performing data cleaning on the Google ads and the business data respectively, and merging the Google ads and the business data to obtain at least one sub-account report includes: Construct a Google report downloader according to the Google Ads API documentation; Call the Google report downloader and custom parameters to obtain the Google ads; wherein, the custom parameters include the start date, end date, and type of the Google ads; Perform data association between the Google ads and the business data to obtain a business identifier; Parse the business identifier through regular expression matching in Python and store it as field data; Use the pandas module in Python to perform data cleaning on the Google ads and the business data respectively according to the field data, and merge the Google ads and the business data to obtain at least one sub-account report.

6. The method for obtaining a report based on the Google Ads API according to claim 1, wherein The data compression process on the merged report to obtain a final report and upload the final report to the cluster for backup includes: Perform data compression processing on the merged report through Python calling system commands according to the lzo data compression algorithm to obtain an lzo compressed file; wherein, the lzo compressed file is the final report.

7. The method for obtaining a report based on the Google Ads API according to claim 1, wherein The data compression process on the merged report to obtain a final report and upload the final report to the cluster for backup further includes: Use Python to rely on kerberos.client in the hdfs package to create an hdfs client; Verify the hdfs link and kerberos in the hdfs client; wherein, the kerberos includes a kerberos key file, ssh authentication, and a hosts white list.

8. A report acquisition device based on the Google Ads API, characterized in that, Includes: A Google verification unit for performing Google permission verification to obtain a Google permission verification file; wherein, the Google permission verification includes verification of the Google background and application on the developer platform; the Google permission verification file includes an access token and a refresh token; A Google initialization unit for constructing a Google configuration file according to the Google permission verification file and performing initialization configuration on the Google configuration file to obtain a Google client; A Google acquisition unit for using the Google client to obtain Google ads and business data respectively, and performing data cleaning on the Google ads and the business data respectively, and merging the Google ads and the business data to obtain at least one sub-account report; A Google merge unit for performing data merge processing on the sub-account reports to obtain a merged report; wherein, the data merge processing includes field renaming, field delimiter setting, character encoding setting, and removing the table header; A Google upload unit for performing data compression processing on the merged report to obtain a final report and uploading the final report to the cluster for backup; wherein, the final report is used for metric calculation and visual display.

9. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the method for obtaining a report based on the Google Ads API according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, it implements the method for obtaining a report based on the Google Ads API according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Advertisement putting request processing method and device

    CN111724179A

  • Advertisement putting method and device, computer equipment and storage medium

    CN113487370A