از 8 سپتامبر 2025 ، هر مورد خط جدید باید اعلام کند که آیا تبلیغات سیاسی اتحادیه اروپا (EU) را ارائه می دهد یا خیر. Display & Video 360 API و بارگذاریهای SDF که اعلانها را ارائه نمیکنند با شکست مواجه میشوند. برای جزئیات بیشتر در مورد نحوه به روز رسانی یکپارچه سازی خود برای ایجاد این اعلامیه، به صفحه لغو اعتبار ما مراجعه کنید.
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
همه موارد خط ایجاد شده با استفاده از Display & Video 360 API در ابتدا در حالت پیشنویس ایجاد میشوند. در این حالت پیشنویس، موارد خط تبلیغاتی را ارائه نمیکنند، بنابراین شما میتوانید تنظیمات و هدفگیری را بدون اینکه این تغییرات بر روی سرویسدهی فعلی تبلیغات تأثیر بگذارد، تنظیم کنید. این صفحه مراحلی را که باید انجام دهید تا تأیید کنید که مورد خط شما برای ارائه تبلیغات آماده است و نحوه بهروزرسانی وضعیت آن به فعال توضیح میدهد.
قبل از فعال سازی چه باید کرد
با توجه به اینکه آیتمهای خطی روشی هستند که درآمد تبلیغات شما از طریق خرید و ارائه آگهی خرج میشود، مهم است که مطمئن شوید که آیتم خط هنگام فعال شدن، تبلیغات را همانطور که در نظر گرفته شده ارائه میکند. در زیر چند نکته وجود دارد که باید قبل از فعال کردن آیتم خط خود در نظر بگیرید:
اطمینان حاصل کنید که تنظیمات پرواز درست است: قسمت flight مورد خط را بررسی کنید تا مطمئن شوید که پنجره پرواز برای آیتم خط به درستی تنظیم شده است. پنجره پرواز یک آیتم خطی ممکن است به صورت سفارشی برای آیتم خط باشد یا با سفارش درج والد به ارث رسیده باشد.
بررسی کنید که هیچ اخطاری وجود ندارد که سرویس مورد خط را مسدود کند: از advertisers.lineItems.get برای بازیابی منبع مورد خطی استفاده کنید و قسمت warningMessages را بررسی کنید تا بررسی کنید که آیتم خط هیچ اخطاری ندارد که ممکن است مانع ارائه خط مورد نظر شود. فهرست LineItemWarningMessage تأثیر هر هشدار را یادداشت می کند.
تأیید کنید که همه منابع اصلی نیز فعال هستند: اگر تبلیغکننده اصلی، کمپین یا سفارش درج یک آیتم خط فعال شروع به ارائه تبلیغات نمیکند. این منابع را با استفاده از روشهای GET در سرویسهای تبلیغکنندگان ، کمپینها و سفارشهای درج بازیابی کنید.
در اینجا مثالی از نحوه استفاده از bulkUpdate برای فعال کردن چندین مورد خط آورده شده است:
جاوا
// Create the line item structure.LineItemtargetLineItem=newLineItem();targetLineItem.setEntityStatus("ENTITY_STATUS_ACTIVE");// Create the bulk update request body.BulkUpdateLineItemsRequestrequestBody=newBulkUpdateLineItemsRequest();requestBody.setLineItemIds(line-item-ids);requestBody.setTargetLineItem(targetLineItem);requestBody.setUpdateMask("entityStatus");// Configure the bulk update request.LineItems.BulkUpdaterequest=service.advertisers().lineItems().bulkUpdate(advertiser-id,requestBody);// Update the line items.BulkUpdateLineItemsResponseresponse=request.execute();// Display the line items that were updated, failed, and skipped.if(response.getUpdatedLineItemIds()!=null){System.out.printf("The following line item IDs were successfully updated: %s.\n",Arrays.toString(response.getUpdatedLineItemIds().toArray()));}if(response.getFailedLineItemIds()!=null){System.out.printf("The following line item IDs failed to update: %s.\n",Arrays.toString(response.getFailedLineItemIds().toArray()));if(response.getErrors()!=null){System.out.printf("The failed updates were caused by the following errors: %s.\n",Arrays.toString(response.getErrors().toArray()));}}if(response.getSkippedLineItemIds()!=null){System.out.printf("The following line items IDs were skipped in the update: %s.\n",Arrays.toString(response.getSkippedLineItemIds().toArray()));}
پایتون
# Create a line item object with only updated entity status.line_item_obj={'entityStatus':'ENTITY_STATUS_ACTIVE'}# Build the bulk update request.bulk_update_request={'lineItemIds':line-item-ids,'targetLineItem':line_item_obj,'updateMask':"entityStatus"}# Update the line items.response=service.advertisers().lineItems().bulkUpdate(advertiserId=advertiser-id,body=bulk_update_request).execute()# Display the line items that were updated, failed, and skipped.if'updatedLineItemIds'inresponse:print("The following line item IDs were updated: %s"%response['updatedLineItemIds'])if'failedLineItemIds'inresponse:print("The following line item IDs failed to update: %s"%response['failedLineItemIds'])if'errors'inresponse:print("The failed updates were caused by the following errors:")forerrorinresponse["errors"]:print("Error code: %s, Message: %s"%(error["code"],error["message"]))if'skippedLineItemIds'inresponse:print("The following line items IDs were skipped in the update:: %s"%response['skippedLineItemIds'])
PHP
// Create request body.$body = new Google_Service_DisplayVideo_BulkUpdateLineItemsRequest();$body->setLineItemIds(line-item-ids);// Create target line item with updated fields.$lineItem = new Google_Service_DisplayVideo_LineItem();$lineItem->setEntityStatus('ENTITY_STATUS_ACTIVE');$body->setTargetLineItem($lineItem);// Set update mask in request body.$body->setUpdateMask("entityStatus");// Call the API, updating the entity status for the identified line item.$response = $service->advertisers_lineItems->bulkUpdate(advertiser-id, $body);// Display the line items that were updated, failed, and skipped.if (!empty($response->getUpdatedLineItemIds())) { printf('The following line item IDs were updated:\n'); foreach ($response->getUpdatedLineItemIds() as $id) { printf('%s\n', $id); }}if (!empty($response->getFailedLineItemIds())) { print('The following line item IDs failed to update:\n'); foreach ($response->getFailedLineItemIds() as $id) { printf('%s\n', $id); } if (!empty($response->getErrors())) { print('The failed updates were caused by the following errors:\n'); foreach ($response->getErrors() as $error) { printf( 'Error Code: %s, Message: %s\n', $error->getCode(), $error->getMessage() ); } }}if (!empty($response->getSkippedLineItemIds())) { print('The following line item IDs were skipped in the update:\n'); foreach ($response->getSkippedLineItemIds() as $id) { printf('%s\n', $id); }}
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eAll Display & Video 360 line items begin in a draft state where they can be freely adjusted without impacting ad serving.\u003c/p\u003e\n"],["\u003cp\u003eBefore activating a line item, ensure the flight settings, absence of warning messages, and the active status of parent resources (advertiser, campaign, insertion order).\u003c/p\u003e\n"],["\u003cp\u003eActivate a line item by changing its \u003ccode\u003eentityStatus\u003c/code\u003e to \u003ccode\u003eENTITY_STATUS_ACTIVE\u003c/code\u003e via the \u003ccode\u003eadvertisers.lineItems.patch\u003c/code\u003e or \u003ccode\u003eadvertisers.lineItems.bulkUpdate\u003c/code\u003e methods.\u003c/p\u003e\n"],["\u003cp\u003eAvoid concurrent \u003ccode\u003epatch\u003c/code\u003e or \u003ccode\u003ebulkUpdate\u003c/code\u003e requests with other updates targeting the same line items or their targeting configurations.\u003c/p\u003e\n"]]],["Line items in the Display & Video 360 API are initially in draft and don't serve ads. Before activation, verify the line item's flight settings, check for warnings using `advertisers.lineItems.get`, and ensure parent resources (advertiser, campaign, insertion order) are active. To activate, update the `entityStatus` to `ENTITY_STATUS_ACTIVE` using `advertisers.lineItems.patch` or `advertisers.lineItems.bulkUpdate`. Concurrent updates to the same line items should be avoided. The provided code samples show how to activate multiple line items using `bulkUpdate`.\n"],null,["# Activate Line Item\n\nAll line items created using the Display \\& Video 360 API are initially created in a draft\nstate. In this draft state, line items don't serve ads, so you are free to\nadjust settings and targeting without those changes affecting any current ad\nserving. This page describes the steps you should take to confirm that your line\nitem is ready for serving ads, and how to update its status to active.\n\nWhat to do before activation\n----------------------------\n\nGiven that line items are the manner in which your ad revenue is spent through\nad buying and serving, it is important to make sure that the line item will\nserve ads as intended when activated. Below are a few things to consider before\nactivating your line item:\n\n- **Make sure the flight settings are correct:** Check the line item's [`flight`](/display-video/api/reference/rest/current/advertisers.lineItems#LineItem.FIELDS.flight) field to make sure that the flight window for the line item is set correctly. The flight window of a line item may be custom to the line item or inherited by the parent insertion order.\n- **Verify that there are no warnings blocking the serving of the line item:** Use [`advertisers.lineItems.get`](/display-video/api/reference/rest/current/advertisers.lineItems/get) to retrieve a line item resource and check the field [`warningMessages`](/display-video/api/reference/rest/current/advertisers.lineItems#LineItem.FIELDS.warning_messages) to verify that the line item has no warnings that may hinder the serving of the line item. The [`LineItemWarningMessage`](/display-video/api/reference/rest/current/advertisers.lineItems#lineitemwarningmessage) enum notes the impact of each warning.\n- **Confirm that all parent resources are also active:** An active line item will not begin to serve ads if its parent advertiser, campaign, or insertion order are not active. Retrieve these resources using the `GET` methods in the [Advertisers](/display-video/api/reference/rest/current/advertisers), [Campaigns](/display-video/api/reference/rest/current/advertisers.campaigns), and [Insertion Orders](/display-video/api/reference/rest/current/advertisers.insertionOrders) services.\n\nActivate a line item\n--------------------\n\nActivate a line item by updating its [`entityStatus`](/display-video/api/reference/rest/current/advertisers.lineItems#LineItem.FIELDS.entity_status) field to\n`ENTITY_STATUS_ACTIVE`. You can update this field for an individual line item\nusing the [`advertisers.lineItems.patch`](/display-video/api/reference/rest/current/advertisers.lineItems/patch) method and for multiple line\nitems within a given advertiser using\n[`advertisers.lineItems.bulkUpdate`](/display-video/api/reference/rest/current/advertisers.lineItems/bulkUpdate).\n| **Warning:** Do not make [`patch`](/display-video/api/reference/rest/current/advertisers.lineItems/patch) or [`bulkUpdate`](/display-video/api/reference/rest/current/advertisers.lineItems/bulkUpdate) requests concurrently with other requests updating the same line items or their targeting.\n\nHere's an example of how to use [`bulkUpdate`](/display-video/api/reference/rest/current/advertisers.lineItems/bulkUpdate) to activate\nmultiple line items: \n\n### Java\n\n```java\n// Create the line item structure.\nLineItem targetLineItem = new LineItem();\ntargetLineItem.setEntityStatus(\"ENTITY_STATUS_ACTIVE\");\n\n// Create the bulk update request body.\nBulkUpdateLineItemsRequest requestBody = new BulkUpdateLineItemsRequest();\nrequestBody.setLineItemIds(line-item-ids);\nrequestBody.setTargetLineItem(targetLineItem);\nrequestBody.setUpdateMask(\"entityStatus\");\n\n// Configure the bulk update request.\nLineItems.BulkUpdate request = service.advertisers().lineItems()\n .bulkUpdate(advertiser-id, requestBody);\n\n// Update the line items.\nBulkUpdateLineItemsResponse response = request.execute();\n\n// Display the line items that were updated, failed, and skipped.\nif (response.getUpdatedLineItemIds() != null) {\n System.out.printf(\n \"The following line item IDs were successfully updated: %s.\\n\",\n Arrays.toString(response.getUpdatedLineItemIds().toArray()));\n}\nif (response.getFailedLineItemIds() != null) {\n System.out.printf(\"The following line item IDs failed to update: %s.\\n\",\n Arrays.toString(response.getFailedLineItemIds().toArray()));\n if (response.getErrors() != null) {\n System.out.printf(\n \"The failed updates were caused by the following errors: %s.\\n\",\n Arrays.toString(response.getErrors().toArray()));\n }\n}\nif (response.getSkippedLineItemIds() != null) {\n System.out.printf(\n \"The following line items IDs were skipped in the update: %s.\\n\",\n Arrays.toString(response.getSkippedLineItemIds().toArray()));\n}\n```\n\n### Python\n\n```python\n# Create a line item object with only updated entity status.\nline_item_obj = {\n 'entityStatus': 'ENTITY_STATUS_ACTIVE'\n}\n\n# Build the bulk update request.\nbulk_update_request = {\n 'lineItemIds': line-item-ids,\n 'targetLineItem': line_item_obj,\n 'updateMask': \"entityStatus\"\n}\n\n# Update the line items.\nresponse = service.advertisers().lineItems().bulkUpdate(\n advertiserId=advertiser-id,\n body=bulk_update_request\n).execute()\n\n# Display the line items that were updated, failed, and skipped.\nif 'updatedLineItemIds' in response:\n print(\"The following line item IDs were updated: %s\"\n % response['updatedLineItemIds'])\nif 'failedLineItemIds' in response:\n print(\"The following line item IDs failed to update: %s\"\n % response['failedLineItemIds'])\n if 'errors' in response:\n print(\"The failed updates were caused by the following errors:\")\n for error in response[\"errors\"]:\n print(\"Error code: %s, Message: %s\" % (error[\"code\"], error[\"message\"]))\nif 'skippedLineItemIds' in response:\n print(\"The following line items IDs were skipped in the update:: %s\"\n % response['skippedLineItemIds'])\n```\n\n### PHP\n\n```php\n// Create request body.\n$body = new Google_Service_DisplayVideo_BulkUpdateLineItemsRequest();\n$body-\u003esetLineItemIds(\u003cvar translate=\"no\"\u003eline-item-ids\u003c/var\u003e);\n\n// Create target line item with updated fields.\n$lineItem = new Google_Service_DisplayVideo_LineItem();\n$lineItem-\u003esetEntityStatus('ENTITY_STATUS_ACTIVE');\n$body-\u003esetTargetLineItem($lineItem);\n\n// Set update mask in request body.\n$body-\u003esetUpdateMask(\"entityStatus\");\n\n// Call the API, updating the entity status for the identified line item.\n$response = $service-\u003eadvertisers_lineItems-\u003ebulkUpdate(\n \u003cvar translate=\"no\"\u003eadvertiser-id\u003c/var\u003e,\n $body\n);\n\n// Display the line items that were updated, failed, and skipped.\nif (!empty($response-\u003egetUpdatedLineItemIds())) {\n printf('The following line item IDs were updated:\\n');\n foreach ($response-\u003egetUpdatedLineItemIds() as $id) {\n printf('%s\\n', $id);\n }\n}\nif (!empty($response-\u003egetFailedLineItemIds())) {\n print('The following line item IDs failed to update:\\n');\n foreach ($response-\u003egetFailedLineItemIds() as $id) {\n printf('%s\\n', $id);\n }\n if (!empty($response-\u003egetErrors())) {\n print('The failed updates were caused by the following errors:\\n');\n foreach ($response-\u003egetErrors() as $error) {\n printf(\n 'Error Code: %s, Message: %s\\n',\n $error-\u003egetCode(),\n $error-\u003egetMessage()\n );\n }\n }\n}\nif (!empty($response-\u003egetSkippedLineItemIds())) {\n print('The following line item IDs were skipped in the update:\\n');\n foreach ($response-\u003egetSkippedLineItemIds() as $id) {\n printf('%s\\n', $id);\n }\n}\n```"]]