ExcludedPlacements doesn't work at all with Youtube channels. Why?

49 views
Skip to first unread message

Oleksandra Kalinina

unread,
Jun 19, 2019, 10:39:46 AM6/19/19
to Google Ads Scripts Forum
No links returned from the excluded placements list, named `Channels`

```
function showAllExcludedPlacementsFromList() {
  var EXCLUDED_PLACEMENT_LIST_NAME = 'Channels';

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

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

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

function main() { 
  showAllExcludedPlacementsFromList()
}

```

the same as the adding new channels to it

```
function addExcludedPlacementsList() {
  var excludedChannels = [
    'UC6YuttrRJ_LZNddA_DJ_VSQ',
  ];

  var excludedPlacementList = AdWordsApp.excludedPlacementLists().withCondition('Name = "Channels"').get().next();

  excludedPlacementList.addExcludedPlacements(excludedChannels);    
}

function main() { 
  addExcludedPlacementsList()  
}

```

Google Ads Scripts Forum Advisor Prod

unread,
Jun 19, 2019, 2:08:53 PM6/19/19
to adwords-scripts+apn2wqc1x3riozpq...@googlegroups.com, adwords-scripts+apn2wqc1x3riozpq...@googlegroups.co, adwords...@googlegroups.com

Hi Oleksandra,

Youtube channels that are inside excluded placement lists are not supported via Google Ads Scripts. If you want to access or create new Youtube channel exclusions (not in lists), you will need to use ExcludedVideoYouTubeChannel.

You can follow our blog for any updates.

Regards,
Anthony
Google Ads Scripts Team



ref:_00D1U1174p._5001UBoDOr:ref
Reply all
Reply to author
Forward
0 new messages