Danh sách vị trí bị loại trừ

Lấy tất cả vị trí trong danh sách vị trí bị loại trừ

function getPlacementsFromExcludedPlacementList(name) {   const excludedPlacementListIterator =       AdsApp.excludedPlacementLists()           .withCondition(`shared_set.name = '${name}'`)           .get();    if (!excludedPlacementListIterator.hasNext()) {     throw new Error(`No excluded placement list with name '${name}' found.`);   }    const excludedPlacementList = excludedPlacementListIterator.next();   return excludedPlacementList.excludedPlacements().get(); }

Thêm vị trí vào danh sách vị trí bị loại trừ

function addPlacementToList(url, name) {   const excludedPlacementListIterator =       AdsApp.excludedPlacementLists()           .withCondition(`shared_set.name = '${name}'`)           .get();    if (!excludedPlacementListIterator.hasNext()) {     throw new Error(`No excluded placement list with name '${name}' found.`);   }   const excludedPlacementList = excludedPlacementListIterator.next();   excludedPlacementList.addExcludedPlacement(url); }