Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Bạn có thể tạo và lập lịch báo cáo bằng cách sử dụng tính năng Hiển thị và Giao diện người dùng Video 360 hoặc
API. Ví dụ: người dùng cuối có thể thiết lập một báo cáo hằng ngày thể hiện số liệu của ngày hôm qua
số lượt hiển thị hoặc báo cáo hằng tháng cho biết tổng mức chi tiêu.
Tạo báo cáo định kỳ
Tạo một báo cáo định kỳ mới trong mục Hiển thị và Giao diện báo cáo Video 360 hoặc
bằng phương thức API queries.create. Đang bật toàn bộ thông tin chi tiết
Hiển thị và Bạn có thể xem chức năng báo cáo của Video 360 và cách tạo báo cáo mới
trong Display & Trang web hỗ trợ Video 360.
Bạn có thể lên lịch tạo báo cáo bằng cách sử dụng trường Repeats trong giao diện người dùng và
Trường schedule trong API. Bạn nên đặt các trường này thành
khoảng thời gian thích hợp.
Sau khi bạn đặt trường thích hợp, báo cáo này sẽ chạy theo lịch đó và
sau đó, bạn sẽ có thể tải các báo cáo đã tạo xuống.
Truy cập báo cáo định kỳ
Báo cáo định kỳ được tạo dưới dạng tệp CSV đơn giản và được lưu trữ tự động
và an toàn trong Google Cloud Storage. Tuy nhiên, bạn không thể truy cập vào
Bộ chứa Google Cloud Storage chứa trực tiếp những tệp này. Thay vào đó,
có thể được tải xuống theo cách thủ công từ Màn hình & Giao diện người dùng của Video 360 hoặc đã truy xuất
theo cách có lập trình bằng cách sử dụng URL được cấp phép trước nhận được từ
API.
Dưới đây là ví dụ về cách sử dụng API để tải tệp báo cáo xuống. Trong phần này
Ví dụ: queries.reports.list được dùng với
orderBy để truy xuất báo cáo gần đây nhất
trong truy vấn. Sau đó
Trường Report.reportMetadata.googleCloudStoragePath là
được dùng để tìm tệp báo cáo và tải nội dung của báo cáo xuống một tệp CSV cục bộ.
longqueryId=query-id;// Call the API, listing the reports under the given queryId from most to// least recent.ListReportsResponsereportListResponse=service.queries().reports().list(queryId).setOrderBy("key.reportId desc").execute();// Iterate over returned reports, stopping once finding a report that// finished generating successfully.ReportmostRecentReport=null;if(reportListResponse.getReports()!=null){for(Reportreport:reportListResponse.getReports()){if(report.getMetadata().getStatus().getState().equals("DONE")){mostRecentReport=report;break;}}}else{System.out.format("No reports exist for query Id %s.\n",queryId);}// Download report file of most recent finished report found.if(mostRecentReport!=null){// Retrieve GCS URL from report object.GenericUrlreportUrl=newGenericUrl(mostRecentReport.getMetadata().getGoogleCloudStoragePath());// Build filename.Stringfilename=mostRecentReport.getKey().getQueryId()+"_"+mostRecentReport.getKey().getReportId()+".csv";// Download the report file.try(OutputStreamoutput=newFileOutputStream(filename)){MediaHttpDownloaderdownloader=newMediaHttpDownloader(Utils.getDefaultTransport(),null);downloader.download(reportUrl,output);}System.out.format("Download of file %s complete.\n",filename);}else{System.out.format("There are no completed report files to download for query Id %s.\n",queryId);}
query_id=query-id# Call the API, listing the reports under the given queryId from most to# least recent.response=service.queries().reports().list(queryId=query_id,orderBy="key.reportId desc").execute()# Iterate over returned reports, stopping once finding a report that# finished generating successfully.most_recent_report=Noneifresponse['reports']:forreportinresponse['reports']:ifreport['metadata']['status']['state']=='DONE':most_recent_report=reportbreakelse:print('No reports exist for query Id %s.'%query_id)# Download report file of most recent finished report found.ifmost_recent_report!=None:# Retrieve GCS URL from report object.report_url=most_recent_report['metadata']['googleCloudStoragePath']# Build filename.output_file='%s_%s.csv'%(report['key']['queryId'],report['key']['reportId'])# Download the report file.withopen(output_file,'wb')asoutput:withclosing(urlopen(report_url))asurl:output.write(url.read())print('Download of file %s complete.'%output_file)else:print('There are no completed report files to download for query Id %s.'%query_id)
PHP
$queryId = query-id;// Call the API, listing the reports under the given queryId from most to// least recent.$optParams = array('orderBy' => "key.reportId desc");$response = $service->queries_reports->listQueriesReports($queryId, $optParams);// Iterate over returned reports, stopping once finding a report that// finished generating successfully.$mostRecentReport = null;if (!empty($response->getReports())) { foreach ($response->getReports() as $report) { if ($report->metadata->status->state == "DONE") { $mostRecentReport = $report; break; } }} else { printf('<p>No reports exist for query ID %s.</p>', $queryId);}// Download report file of most recent finished report found.if ($mostRecentReport != null) { // Build filename. $filename = $mostRecentReport->key->queryId . '_' . $mostRecentReport->key->reportId . '.csv'; // Download the report file. file_put_contents($filename, fopen($mostRecentReport->metadata->googleCloudStoragePath, 'r')); printf('<p>Download of file %s complete.</p>', $filename);} else { printf('<p>There are no completed report files to download for query Id %s.</p>', $queryId);}
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eYou can schedule reports using the Display & Video 360 UI or the API to automate report generation based on desired intervals.\u003c/p\u003e\n"],["\u003cp\u003eAccess and download scheduled Display & Video 360 reports, stored as CSV files in Google Cloud Storage, through the UI or programmatically via pre-authorized URLs.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code samples demonstrate retrieving the most recent report and downloading it locally using the Display & Video 360 API in Java, Python, and PHP.\u003c/p\u003e\n"]]],["Reports in Google Display & Video 360 can be created and scheduled via the UI or API, using fields like `Repeats` or `schedule` to define the time interval. Generated CSV reports are stored in Google Cloud Storage. To access reports, users can manually download them from the UI or programmatically retrieve them using pre-authorized URLs obtained from the API. The API method `queries.reports.list` can be used to find the most recent report, and `Report.reportMetadata.googleCloudStoragePath` to get the file path for download.\n"],null,["# Create and Access Scheduled Reports\n\nYou can create and schedule reports using the Google Display \\& Video 360 UI or the\nAPI. For example, end users can set up a daily report showing yesterday's\nimpressions, or a monthly report showing total spend.\n| **Note:** Accessing reports using this approach only allows for read-only retrieval of reports that have already been set up in the Display \\& Video 360 UI; it does not provide any opportunity to modify existing reports or create new reports.\n\nCreate Scheduled Reports\n------------------------\n\nCreate a new scheduled report in the Display \\& Video 360 reporting interface or\nwith the [`queries.create`](/bid-manager/reference/rest/v2/queries/create) API method. Full details on\nDisplay \\& Video 360's reporting functionality and how to create new reports can be\nfound in the [Display \\& Video 360 support site](//support.google.com/displayvideo/answer/6375151).\n\nReports can be scheduled at creation using the `Repeats` field in the UI and the\n[`schedule`](/bid-manager/reference/rest/v2/queries#Query.FIELDS.schedule) field in the API. These fields should be set to an\nappropriate time interval.\n\nAfter the proper field has been set, this report will run at that schedule and\nthe generated reports will then be available for download.\n\nAccess Scheduled Reports\n------------------------\n\nScheduled reports are generated as simple CSV files and are stored automatically\nand securely in Google Cloud Storage. It isn't possible, however, to access the\nGoogle Cloud Storage buckets which contain these files directly. Instead, the\nfiles may be manually downloaded from the Display \\& Video 360 UI or retrieved\nprogrammatically using [pre-authorized URLs](/bid-manager/reference/rest/v2/queries.reports#ReportMetadata.FIELDS.google_cloud_storage_path) obtained from\nthe API.\n\nAn example of using the API to download a report file is provided below. In this\nexample, [`queries.reports.list`](/bid-manager/reference/rest/v2/queries.reports/list) is used with the\n[`orderBy`](/bid-manager/reference/rest/v2/queries.reports/list#body.QUERY_PARAMETERS.order_by) parameter to retrieve the most recent report\nunder a query. Then the\n[`Report.reportMetadata.googleCloudStoragePath`](/bid-manager/reference/rest/v2/queries.reports#ReportMetadata.FIELDS.google_cloud_storage_path) field is\nused to locate the report file and download its contents to a local CSV file. \n\n### Java\n\nRequired imports: \n\n```java\nimport com.google.api.client.googleapis.media.MediaHttpDownloader;\nimport com.google.api.client.googleapis.util.Utils;\nimport com.google.api.client.http.GenericUrl;\nimport com.google.api.services.doubleclickbidmanager.DoubleClickBidManager;\nimport com.google.api.services.doubleclickbidmanager.model.ListReportsResponse;\nimport com.google.api.services.doubleclickbidmanager.model.Report;\nimport java.io.FileOutputStream;\nimport java.io.OutputStream;\n```\n\nCode example: \n\n```java\nlong queryId = query-id;\n\n// Call the API, listing the reports under the given queryId from most to\n// least recent.\nListReportsResponse reportListResponse =\n service\n .queries()\n .reports()\n .list(queryId)\n .setOrderBy(\"key.reportId desc\")\n .execute();\n\n// Iterate over returned reports, stopping once finding a report that\n// finished generating successfully.\nReport mostRecentReport = null;\nif (reportListResponse.getReports() != null) {\n for (Report report : reportListResponse.getReports()) {\n if (report.getMetadata().getStatus().getState().equals(\"DONE\")) {\n mostRecentReport = report;\n break;\n }\n }\n} else {\n System.out.format(\"No reports exist for query Id %s.\\n\", queryId);\n}\n\n// Download report file of most recent finished report found.\nif (mostRecentReport != null) {\n // Retrieve GCS URL from report object.\n GenericUrl reportUrl =\n new GenericUrl(mostRecentReport.getMetadata().getGoogleCloudStoragePath());\n\n // Build filename.\n String filename =\n mostRecentReport.getKey().getQueryId() + \"_\"\n + mostRecentReport.getKey().getReportId() + \".csv\";\n\n // Download the report file.\n try (OutputStream output = new FileOutputStream(filename)) {\n MediaHttpDownloader downloader =\n new MediaHttpDownloader(Utils.getDefaultTransport(), null);\n downloader.download(reportUrl, output);\n }\n System.out.format(\"Download of file %s complete.\\n\", filename);\n} else {\n System.out.format(\n \"There are no completed report files to download for query Id %s.\\n\",\n queryId);\n}\n```\n\n### Python\n\nRequired imports: \n\n```python\nfrom contextlib import closing\nfrom six.moves.urllib.request import urlopen\n```\n\nCode example: \n\n```python\nquery_id = query-id\n\n# Call the API, listing the reports under the given queryId from most to\n# least recent.\nresponse = service.queries().reports().list(queryId=query_id, orderBy=\"key.reportId desc\").execute()\n\n# Iterate over returned reports, stopping once finding a report that\n# finished generating successfully.\nmost_recent_report = None\nif response['reports']:\n for report in response['reports']:\n if report['metadata']['status']['state'] == 'DONE':\n most_recent_report = report\n break\nelse:\n print('No reports exist for query Id %s.' % query_id)\n\n# Download report file of most recent finished report found.\nif most_recent_report != None:\n # Retrieve GCS URL from report object.\n report_url = most_recent_report['metadata']['googleCloudStoragePath']\n\n # Build filename.\n output_file = '%s_%s.csv' % (report['key']['queryId'], report['key']['reportId'])\n\n # Download the report file.\n with open(output_file, 'wb') as output:\n with closing(urlopen(report_url)) as url:\n output.write(url.read())\n print('Download of file %s complete.' % output_file)\nelse:\n print('There are no completed report files to download for query Id %s.' % query_id)\n```\n\n### PHP\n\n```php\n$queryId = \u003cvar translate=\"no\"\u003equery-id\u003c/var\u003e;\n\n// Call the API, listing the reports under the given queryId from most to\n// least recent.\n$optParams = array('orderBy' =\u003e \"key.reportId desc\");\n$response = $service-\u003equeries_reports-\u003elistQueriesReports($queryId, $optParams);\n\n// Iterate over returned reports, stopping once finding a report that\n// finished generating successfully.\n$mostRecentReport = null;\nif (!empty($response-\u003egetReports())) {\n foreach ($response-\u003egetReports() as $report) {\n if ($report-\u003emetadata-\u003estatus-\u003estate == \"DONE\") {\n $mostRecentReport = $report;\n break;\n }\n }\n} else {\n printf('\u003cp\u003eNo reports exist for query ID %s.\u003c/p\u003e', $queryId);\n}\n\n// Download report file of most recent finished report found.\nif ($mostRecentReport != null) {\n // Build filename.\n $filename = $mostRecentReport-\u003ekey-\u003equeryId . '_' . $mostRecentReport-\u003ekey-\u003ereportId . '.csv';\n\n // Download the report file.\n file_put_contents($filename, fopen($mostRecentReport-\u003emetadata-\u003egoogleCloudStoragePath, 'r'));\n printf('\u003cp\u003eDownload of file %s complete.\u003c/p\u003e', $filename);\n} else {\n printf('\u003cp\u003eThere are no completed report files to download for query Id %s.\u003c/p\u003e', $queryId);\n}\n```"]]