This is the legacy documentation for Google Ads scripts. Go to the current docs.

Excluded Placement Lists

Stay organized with collections Save and categorize content based on your preferences.

Show all the shared excluded placements in an excluded placement list

function showAllExcludedPlacementsFromList() {
  var EXCLUDED_PLACEMENT_LIST_NAME = 'INSERT_LIST_NAME_HERE';

  var excludedPlacementListIterator =
      AdsApp.excludedPlacementLists()
          .withCondition('Name = "' + EXCLUDED_PLACEMENT_LIST_NAME + '"')
          .get();

  if (excludedPlacementListIterator.totalNumEntities() == 1) {
    var excludedPlacementList = excludedPlacementListIterator.next();
    var sharedExcludedPlacementIterator =
        excludedPlacementList.excludedPlacements().get();

    while (sharedExcludedPlacementIterator.hasNext()) {
      var sharedExcludedPlacement = sharedExcludedPlacementIterator.next();
      Logger.log(sharedExcludedPlacement.getUrl());
    }
  }
}