Скрипт Google Ads остановка групп объявлений без активных ключей

    Нужна консультация?
    Создание сайтов

    Более 500 сайтов разработано

    Контекстная реклама

    Более 500 успешных клиентов

    Продвижение сайтов

    Более 1000 ключевых слов в ТОП10

    Как массово отключить не рабочие группы без ключевых слов? Скрипт отключения групп объявлений без ключей Google Ads остановка групп объявлений без активных ключей, необходимо создать скрипт и запустить, будут остановлены все группы и в КМС рабочие, так как там объявления без ключей!

     

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    /*********************************************
    * Pause AdGroups With No Active Keywords
    * Version 1.1
    * Changelog v1.1
    *   - Updated for speed and added comments
    * Created By: Russ Savage
    * FreeAdWordsScripts.com
    **********************************************/
    function main() {
      // Let's start by getting all of the active AdGroups
      var agIter = AdWordsApp.adGroups()
        .withCondition('CampaignStatus = ENABLED')
        .withCondition('Status = ENABLED')
        .get();
     
      // It is faster to store them and process them all at once later
      var toPause = [];
      // Then we will go through each one
      while(agIter.hasNext()) {
        var ag = agIter.next();
        //get all the keywords that are enabled
        var kwIter = ag.keywords()
          .withCondition("Status = ENABLED")
          .get();
        
        //If .hasNext() is true, there is at least 1 kw in the AdGroup
        var hasKw = kwIter.hasNext();
        if(!hasKw) {
          toPause.push(ag);
        }
      }
      
      // Now we process them all at once to take advantage of batch processing
      for(var i in toPause) {
        toPause[i].pause();
      }
    }

    https://www.freeadwordsscripts.com/2012/11/pause-adgroups-with-no-active-keywords.html

    Для исключения и включения определенных компании, нужно вписать :

    23
    24
    .withCondition("CampaignName CONTAINS_IGNORE_CASE 'Название-нужной-компании-Поиск'")
    .withCondition("CampaignName DOES_NOT_CONTAIN 'Название-не-нужной-компании-Display'")

     

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    /*********************************************
    * Pause AdGroups With No Active Keywords
    * Version 1.1
    * Changelog v1.1
    *   - Updated for speed and added comments
    * Created By: Russ Savage
    * FreeAdWordsScripts.com
    **********************************************/
    function main() {
      // Let's start by getting all of the active AdGroups
      var agIter = AdWordsApp.adGroups()
        .withCondition('CampaignStatus = ENABLED')
        .withCondition('Status = ENABLED')
        .get();
     
      // It is faster to store them and process them all at once later
      var toPause = [];
      // Then we will go through each one
      while(agIter.hasNext()) {
        var ag = agIter.next();
        //get all the keywords that are enabled
        var kwIter = ag.keywords()
          .withCondition("Status = ENABLED")
          .withCondition("CampaignName CONTAINS_IGNORE_CASE 'Название-нужной-компании-Поиск'")
          .withCondition("CampaignName DOES_NOT_CONTAIN 'Название-не-нужной-компании-Display'")
          .get();
        
        //If .hasNext() is true, there is at least 1 kw in the AdGroup
        var hasKw = kwIter.hasNext();
        if(!hasKw) {
          toPause.push(ag);
        }
      }
      
      // Now we process them all at once to take advantage of batch processing
      for(var in toPause) {
        toPause[i].pause();
      }
    }