📜 ⬆️ ⬇️

Battle for adults: how to exclude children's channels from advertising on Youtube 24/7?

Prehistory


Many people remember the recent scandal about the refusal of large advertisers to post on YouTube due to the fact that their prerolls (paid videos before the video, which can be skipped after 5 seconds) were shown in the video with unwanted content. However, in this article we will discuss another problem - children's content. The fact is that even with the correct targeting settings for an adult audience, a huge number (up to 90%) of shows are received by children's channels. This is due to the fact that parents from their "adult" accounts on their devices, both mobile and desktop, put cartoons for children. Of course, advertisers do not want to spend the advertising budget on children who simply view prerolls, since it has almost no effect. Such videos and channels can be eliminated with the help of negative keywords or the exclusion of entire topics, but it is long, difficult and will exclude not all channels and videos - children's content is quite diverse. Many little-known children's channels and videos continue to show ads in them due to the fact that they have common, childish names or inadequate descriptions are not typical, but children in large numbers still watch them. I decided to find a way to automate the search and exclusion of similar channels using AdWords scripts.

image

Solution 1


So, I started to create my first script to search for children's channels. AdWords allows you to create your own JS scripts to manage your advertising account. They are based on Google Apps Scripts and their main advantage is integration with other Google services, such as Google Drive, Spreadsheets, YouTube, Analytics, BigQuery, etc., as well as the ability to connect third-party APIs. Before that, I had to work with YouTube Data API v3 to search for videos as a placement. I will try to tell about it in another article. So, by experience it turned out to establish that children's videos are united not by their titles, but by their tags . By slightly modifying the script for searching YouTube videos, I found similar tags for various requests from children's cartoons and saved them in Google Spreadsheet for future use in the new script. The file is public, but I recommend before setting up the script to copy it to yourself in Google Drive and replace the file id in the script with a new one.

Key points for understanding the script:
')
  1. From URL_PERFORMANCE_REPORT, we get all the links from the YouTube placements and get the videoId for yesterday.

    var report = AdWordsApp.report( 'SELECT Url ' + 'FROM URL_PERFORMANCE_REPORT ' + 'WHERE CampaignName CONTAINS "Video" ' + 'DURING YESTERDAY'); var rows = report.rows(); while (rows.hasNext()) { var row = rows.next(); var videoId = row['Url'].toString().replace('www.youtube.com/video/',''); videoIdList.push([videoId]); } 

  2. In the cycle we send requests to YouTube with each video id. From the answer, we get the tags and IDs of the video channel and check all the tags for intersection with our library of children's tags.

     for (var i = 0; i < videoList.length; i++) { var results = YouTube.Videos.list('snippet', {id: videoList[i]}); try { if (results.items[0].snippet !== undefined) { var channelId = results.items[0].snippet.channelId; var tags = results.items[0].snippet.tags; if (uniqueChannel[channelId] !== true){ for (var k = 0; k < tags.length; k++) { if (tagsObj[tags[k]] !== undefined) { channels.push([channelId]); uniqueChannel[channelId] = true; Logger.log("    - " + channelId); break; } else { continue; }; } } } } catch (e) { Logger.log(e); } } 

    If any of the video tags matches the tags from the library, the video channel id is sent to the array to be excluded if it has not already been added via another video from the same channel.

  3. After all the videos have been checked, we launch a cycle to add all channels to the list of excluded sites in your AdWords account. A list with a name identical to that in the script (I just have “Video Channels”) needs to be created in advance. The limit for the list of excluded sites in the list is 65,000, problems with its overflow should not arise.

     var excludedPlacementList = AdWordsApp.excludedPlacementLists().withCondition('Name = ""').get().next(); for (var d = 0; d < channels.length; d++) { excludedPlacementList.addExcludedPlacement("youtube.com/channel/"+channels[d].toString()); }; 

Problems using the first version of the script


A fairly simple and effective solution, but as it turned out, not everything is so simple. When using this script, I had the following problem: when launching sweeping video campaigns, the script did not have time to process all the videos for yesterday - rested against the time limit of 30 minutes (internal AdWords limit), and did not add new exceptions. In addition, it is better to add video as often as possible and faster to save maximum funds. Unfortunately, even after adding a video to the list of exceptions, they, by experience, do not begin to act immediately. Google Support says a period of up to 2 days (as observed, usually earlier).

Therefore, the file on a separate page already has a list of channels accumulated during the script's work, it is better to add them to exceptions in advance.

Solution 2


After testing the first version of the script with a friend, an automation fan, I realized that I had to check every hour and not check videos that had already been checked before, otherwise the script would start to rest on the limit of 30 minutes by noon. The decision was taken from another script to change rates from hour to hour, who are interested, here is a link to such a decision. Everything turned out a little harder compared to the first version, but the result was excellent. They added the functionality of saving to the txt-file of already checked videos in Google Drive, there are recorded all the id for today, in order to compare them with the new report every hour. The comparison is performed using the difference method from the free Underscore.js library.

 var videoList = _.difference(videoIdList, data); 

At the output we get an array of exclusively new videoId for the last hour, which we check in the scheme of the first script for the occurrence of tags. And at the end of the script, we add to the same txt file all the videos for the current day.

Script Setup


  1. Specify the name of the file to be created in Google Drive

     var dataFile = "videoIds.txt"; 

    If there is no such file yet, it will be created automatically.

  2. Select campaigns to check

     'WHERE CampaignName CONTAINS "(Video)" 

    AWQL syntax is in AdWords Help.

  3. Replace the Google Spreadsheet id with your

     var spreadsheet = SpreadsheetApp.openById('11PMGc70yLE88Npi47Hwb6W36Y8yjw2N2CdXXLgdK12o'); 

  4. In the AdWords interface, create a generic list of placements to exclude.

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

    and paste its name instead of "Video Channels".

  5. Turn on YouTube’s advanced APIs.

  6. After the first views, enable the YouTube API in the Google Developers Console. The link will be in the error log.

  7. Configure the schedule of operation of the “Every hour” script.

Done!

The final


As a result, we received a script that checks children's channels every hour and does not rest on the time limit. From other utilities, you can customize the script to any subject by adding new tags to the spreadsheet file. The code of the updated script posted here . I am pleased to answer questions and suggestions.

Sometimes adult channels get into exceptions, but this happens quite rarely. There may be two reasons - either the owner of the channel places not only adults, but also children's videos in it, or he intentionally uses children's tags to cheat and expand the audience. According to the observations, after you start using the script, the view rate (VTR, View-through rate) will decrease significantly, as adults press the “skip” button much more often than children.

Use and post on the right channels!

Source: https://habr.com/ru/post/325814/


All Articles