Last active
July 17, 2018 18:50
-
-
Save simeonpashley/d1739527bff352f2364b7330bb7514bc to your computer and use it in GitHub Desktop.
AdWords Shopping Bidder - CPA Target £20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() { | |
var targetCPA = 20; | |
var productGroupSelector = AdWordsApp | |
.productGroups() | |
.withCondition("Impressions > 100") | |
.forDateRange("LAST_MONTH") | |
.orderBy("Clicks DESC"); | |
var productGroupIterator = productGroupSelector.get(); | |
while (productGroupIterator.hasNext()) { | |
var productGroup = productGroupIterator.next(); | |
var conversionRate = productGroup.getStatsFor("LAST_MONTH").getConversionRate(); | |
productGroup.setMaxCpc(targetCPA * conversionRate) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment