با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
میتوانید با استفاده از Google Display & Video 360 UI یا API گزارشها را ایجاد و زمانبندی کنید. برای مثال، کاربران نهایی میتوانند گزارش روزانهای تنظیم کنند که برداشتهای دیروز را نشان میدهد، یا یک گزارش ماهانه که کل هزینهها را نشان میدهد.
ایجاد گزارش های زمان بندی شده
یک گزارش زمانبندیشده جدید در رابط گزارشدهی Display & Video 360 یا با روش queries.create API ایجاد کنید. جزئیات کامل در مورد عملکرد گزارشدهی Display & Video 360 و نحوه ایجاد گزارشهای جدید را میتوانید در سایت پشتیبانی Display & Video 360 بیابید.
گزارش ها را می توان در زمان ایجاد با استفاده از قسمت Repeats در UI و فیلد schedule در API برنامه ریزی کرد. این فیلدها باید روی یک بازه زمانی مناسب تنظیم شوند.
پس از تنظیم فیلد مناسب، این گزارش در آن زمان بندی اجرا می شود و گزارش های تولید شده برای دانلود در دسترس خواهند بود.
دسترسی به گزارش های زمان بندی شده
گزارشهای زمانبندیشده بهعنوان فایلهای CSV ساده تولید میشوند و بهطور خودکار و ایمن در Google Cloud Storage ذخیره میشوند. با این حال، دسترسی به سطلهای Google Cloud Storage که حاوی این فایلها هستند، امکانپذیر نیست. درعوض، ممکن است فایلها بهصورت دستی از رابط کاربری Display & Video 360 دانلود شوند یا با استفاده از URLهای از پیش مجاز بهدستآمده از API، بهصورت برنامهنویسی بازیابی شوند.
نمونه ای از استفاده از API برای دانلود فایل گزارش در زیر ارائه شده است. در این مثال، queries.reports.list با پارامتر orderBy برای بازیابی آخرین گزارش تحت یک پرس و جو استفاده می شود. سپس از قسمت Report.reportMetadata.googleCloudStoragePath برای مکان یابی فایل گزارش و دانلود محتوای آن در یک فایل CSV محلی استفاده می شود.
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);}
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\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```"]]