제외 게재위치 목록
제외 게재위치 목록에 있는 모든 게재위치 가져오기
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();
}
제외 게재위치 목록에 게재위치 추가하기
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);
}
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-09-12(UTC)
[null,null,["최종 업데이트: 2024-09-12(UTC)"],[[["The provided code snippets demonstrate how to retrieve all placements within a specified excluded placement list using `getPlacementsFromExcludedPlacementList` function."],["The `addPlacementToList` function enables adding a new placement to an existing excluded placement list by utilizing its URL and list name."],["Both functions utilize the `AdsApp.excludedPlacementLists()` method for accessing and manipulating excluded placement lists within Google Ads, throwing an error if the specified list name isn't found."]]],[]]