Google Ads script
/**
* Goodlabs Google Ads script: junk placement finder
* Schedule: Daily at 04:00
*/
var CONFIG = {
JUNK_PATTERNS: [
"anonymous.google", "game", "puzzle", "arcade", "kids", "baby",
"cartoon", "lyrics", "apk", "mod", "cheats", "download", "free"
]
};
function main() {
Logger.log("Starting Goodlabs Placement Cleaner...");
var report = AdsApp.report(
"SELECT group_placement_view.target_url, campaign.name, metrics.impressions, " +
"metrics.clicks, metrics.cost_micros, metrics.conversions " +
"FROM group_placement_view " +
"WHERE metrics.impressions > 20 " +
"AND segments.date DURING LAST_14_DAYS"
);
var junkList = [];
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
var url = String(row["group_placement_view.target_url"] || "").toLowerCase();
var imps = Number(row["metrics.impressions"] || 0);
var convs = Number(row["metrics.conversions"] || 0);
var cost = Number(row["metrics.cost_micros"] || 0) / 1e6;
var isJunk = false;
for (var i = 0; i < CONFIG.JUNK_PATTERNS.length; i++) {
if (url.indexOf(CONFIG.JUNK_PATTERNS[i]) !== -1) {
isJunk = true;
break;
}
}
if (isJunk && convs === 0) {
junkList.push({ url: url, campaign: row["campaign.name"], cost: cost, imps: imps });
}
}
Logger.log("Found " + junkList.length + " junk placements to exclude.");
junkList.forEach(function(p) {
Logger.log(p.url + " | " + p.campaign + " | cost " + p.cost.toFixed(2) + " | " + p.imps + " impressions");
});
}How it works
- Queries
group_placement_view, the "Where ads showed" data, for placements with more than 20 impressions in one ad group in the last 14 days. A placement that passes in several ad groups is logged once per ad group. - Checks each placement URL against
JUNK_PATTERNS: game, puzzle, arcade, kids, baby, cartoon, lyrics, apk, mod, cheats, download, free and anonymous.google. - Keeps the matches with zero conversions and writes each one to the script log with its campaign, cost and impressions. The script does not add exclusions itself.
Installation
- In Google Ads, open Tools > Bulk actions > Scripts and create a script.
- Edit JUNK_PATTERNS if your niche needs other words.
- Authorize and schedule it daily at 04:00.
Questions
Does this work for Performance Max?
No. PMax placements are not in group_placement_view. They sit in performance_max_placement_view, which reports impressions only, with no cost or conversions, so the zero-conversion filter has nothing to check.