Excluded Placement Lists

Show all the shared excluded placements in an excluded placement list

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

  var excludedPlacementListIterator =
      AdWordsApp.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());
    }
  }
}

Feedback geben zu...

AdWords Scripts
AdWords Scripts