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.
Dịch vụ Display & Video 360 (DV360) cho phép bạn sử dụng DV360 API trong Apps Script. API này cung cấp quyền truy cập theo phương pháp có lập trình vào Display & Video API.
Tài liệu tham khảo
Để biết thông tin chi tiết về dịch vụ này, hãy xem tài liệu tham khảo cho DV360 API. Giống như tất cả các dịch vụ nâng cao trong Apps Script, dịch vụ DV360 sử dụng các đối tượng, phương thức và tham số giống như API công khai. Để biết thêm thông tin, hãy xem bài viết Cách xác định chữ ký phương thức.
/** * Logs all of the partners available in the account. */functionlistPartners(){// Retrieve the list of available partnerstry{constpartners=DisplayVideo.Partners.list();if(partners.partners){// Print out the ID and name of eachfor(leti=0;i < partners.partners.length;i++){constpartner=partners.partners[i];console.log('Found partner with ID %s and name "%s".',partner.partnerId,partner.displayName);}}}catch(e){// TODO (Developer) - Handle exceptionconsole.log('Failed with error: %s',e.error);}}
Nhận danh sách các chiến dịch đang hoạt động
Mẫu này ghi lại tên và mã nhận dạng của tất cả chiến dịch đang hoạt động. Lưu ý việc sử dụng mã thông báo phân trang để truy xuất toàn bộ danh sách.
/** * Logs names and ID's of all active campaigns. * Note the use of paging tokens to retrieve the whole list. */functionlistActiveCampaigns(){constadvertiserId='1234567';// Replace with your advertiser ID.letresult;letpageToken;try{do{result=DisplayVideo.Advertisers.Campaigns.list(advertiserId,{'filter':'entityStatus="ENTITY_STATUS_ACTIVE"','pageToken':pageToken});if(result.campaigns){for(leti=0;i < result.campaigns.length;i++){constcampaign=result.campaigns[i];console.log('Found campaign with ID %s and name "%s".',campaign.campaignId,campaign.displayName);}}pageToken=result.nextPageToken;}while(pageToken);}catch(e){// TODO (Developer) - Handle exceptionconsole.log('Failed with error: %s',e.error);}}
/** * Updates the display name of a line item */functionupdateLineItemName(){constadvertiserId='1234567';// Replace with your advertiser ID.constlineItemId='123456789';//Replace with your line item ID.constupdateMask="displayName";constlineItemDef={displayName:'New Line Item Name (updated from Apps Script!)'};try{constlineItem=DisplayVideo.Advertisers.LineItems.patch(lineItemDef,advertiserId,lineItemId,{updateMask:updateMask});}catch(e){// TODO (Developer) - Handle exceptionconsole.log('Failed with error: %s',e.error);}}
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[],[]]