שירות DoubleClick Bid Manager
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
שירות DoubleClick Bid Manager מאפשר לכם להשתמש ב-DV360 Bid Manager API ב-Apps Script. ממשק ה-API הזה מספק גישה פרוגרמטית לדוחות של DoubleClick Bid Manager (DBM).
חומרי עזר
מידע מפורט על השירות הזה מופיע במאמרי העזרה בנושא DBM Reporting API. בדומה לכל השירותים המתקדמים ב-Apps Script, שירות DoubleClick Bid Manager משתמש באותם אובייקטים, שיטות ופרמטרים כמו ממשק ה-API הציבורי. מידע נוסף זמין במאמר איך נקבעות חתימות של שיטות.
כדי לדווח על בעיות ולמצוא תמיכה נוספת, אפשר לעיין במדריך התמיכה בנושא דיווח וניהול תנועה ב-DBM.
קוד לדוגמה
בדוגמת הקוד הבאה נעשה שימוש בגרסה 2 של ה-API.
איך מקבלים רשימה של שאילתות
בדוגמה הזו מתבצעת רישום ביומן של כל השאילתות שזמינות בחשבון.
יצירה והרצה של שאילתה
בדוגמה הזו נוצרת שאילתה חדשה של DBM והיא מופעלת.
שליפת הדוח האחרון לשאילתת DBM
בדוגמה הזו מתבצעת אחזור של הדוח האחרון לשאילתת DBM ורישום של התוכן ביומן.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-31 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-31 (שעון UTC)."],[],[],null,["# DoubleClick Bid Manager Service\n\nThe DoubleClick Bid Manager service lets you use the\n[DV360 Bid Manager API](/bid-manager)\nin Apps Script. This API provides programmatic access to DoubleClick Bid\nManager (DBM) Reporting.\n| **Note:** This is an advanced service that must be [enabled before use](/apps-script/guides/services/advanced).\n\nReference\n---------\n\nFor detailed information on this service, see the\n[reference documentation](/bid-manager/reference/rest) for the\nDBM Reporting API. Like all advanced services in Apps\nScript, the DoubleClick Bid Manager service uses the same objects, methods, and\nparameters as the public API. For more information, see [How method signatures are determined](/apps-script/guides/services/advanced#how_method_signatures_are_determined).\n\nTo report issues and find other support, see the\n[DBM Reporting and Trafficking support guide](/bid-manager/support).\n\nSample code\n-----------\n\nThe following sample code uses\n[version 2](/bid-manager/reference/rest) of the API.\n\n### Get a list of queries\n\nThis sample logs all of the queries available in the account. \nadvanced/doubleclickbidmanager.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/advanced/doubleclickbidmanager.gs) \n\n```javascript\n/**\n * Logs all of the queries available in the account.\n */\nfunction listQueries() {\n // Retrieve the list of available queries\n try {\n const queries = DoubleClickBidManager.Queries.list();\n\n if (queries.queries) {\n // Print out the ID and name of each\n for (let i = 0; i \u003c queries.queries.length; i++) {\n const query = queries.queries[i];\n console.log('Found query with ID %s and name \"%s\".',\n query.queryId, query.metadata.title);\n }\n }\n } catch (e) {\n // TODO (Developer) - Handle exception\n console.log('Failed with error: %s', e.error);\n }\n}\n```\n\n### Create and run a query\n\nThis sample creates and runs a new DBM query. \nadvanced/doubleclickbidmanager.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/advanced/doubleclickbidmanager.gs) \n\n```javascript\n/**\n * Create and run a new DBM Query\n */\nfunction createAndRunQuery() {\n let result;\n let execution;\n //We leave the default date range blank for the report run to\n //use the value defined during query creation\n let defaultDateRange = {}\n let partnerId = \"1234567\" //Replace with your Partner ID\n let query = {\n \"metadata\": {\n \"title\": \"Apps Script Example Report\",\n \"dataRange\": {\n \"range\": \"YEAR_TO_DATE\"\n },\n \"format\": \"CSV\"\n },\n \"params\": {\n \"type\": \"STANDARD\",\n \"groupBys\": [\n \"FILTER_PARTNER\",\n \"FILTER_PARTNER_NAME\",\n \"FILTER_ADVERTISER\",\n \"FILTER_ADVERTISER_NAME\",\n ],\n \"filters\": [\n {\"type\": \"FILTER_PARTNER\",\"value\": partnerId}\n ],\n \"metrics\": [\n \"METRIC_IMPRESSIONS\"\n ]\n },\n \"schedule\": {\n \"frequency\": \"ONE_TIME\"\n }\n }\n\n try {\n result = DoubleClickBidManager.Queries.create(query);\n if (result.queryId) {\n console.log('Created query with ID %s and name \"%s\".',\n result.queryId, result.metadata.title);\n execution = DoubleClickBidManager.Queries.run(defaultDateRange, result.queryId);\n if(execution.key){\n console.log('Created query report with query ID %s and report ID \"%s\".',\n execution.key.queryId, execution.key.reportId);\n }\n }\n } catch (e) {\n // TODO (Developer) - Handle exception\n console.log(e)\n console.log('Failed with error: %s', e.error);\n }\n}\n```\n\n### Fetch the most recent report for a DBM query\n\nThis sample fetches the most recent report for a DBM query and logs the content. \nadvanced/doubleclickbidmanager.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/advanced/doubleclickbidmanager.gs) \n\n```javascript\n/**\n * Fetches a report file\n */\nfunction fetchReport() {\n const queryId = '1234567'; // Replace with your query ID.\n const orderBy = \"key.reportId desc\";\n\n try {\n const report = DoubleClickBidManager.Queries.Reports.list(queryId, {orderBy:orderBy});\n if(report.reports){\n const firstReport = report.reports[0];\n if(firstReport.metadata.status.state == 'DONE'){\n const reportFile = UrlFetchApp.fetch(firstReport.metadata.googleCloudStoragePath)\n console.log(\"Printing report content to log...\")\n console.log(reportFile.getContentText())\n }\n else{\n console.log(\"Report status is %s, and is not available for download\", firstReport.metadata.status.state)\n }\n }\n\n } catch (e) {\n // TODO (Developer) - Handle exception\n console.log(e)\n console.log('Failed with error: %s', e.error);\n }\n}\n```"]]