निकाले गए प्लेसमेंट की सूचियां

निकाले गए प्लेसमेंट की सूची से सभी प्लेसमेंट पाएं

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);
}