Last active
August 29, 2015 14:19
-
-
Save soeirosantos/7c45d297c116b4c141d3 to your computer and use it in GitHub Desktop.
Script da API do Google Ad Words que coloca um rótulo em todas as keywords que se aplicam a um determinado filtro.
This file contains hidden or 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 IMPRESSIONS = 10; | |
var CTR = 0.01; | |
//var AVG_CPC = 2.00; | |
var keywords = AdWordsApp.keywords(). | |
withCondition('CampaignStatus = ENABLED'). | |
withCondition('AdGroupStatus = ENABLED'). | |
withCondition('Status = ENABLED'). | |
withCondition('Ctr > ' + CTR). | |
withCondition('Impressions > ' + IMPRESSIONS). | |
//withCondition('AverageCpc > ' + AVG_CPC). | |
forDateRange('LAST_30_DAYS'). | |
get(); | |
while (keywords.hasNext()) { | |
var keyword = keywords.next(); | |
Logger.log('Aplicando rotulo em: ' + keyword.getText()); | |
//ATENCAO: O marcador precisa ser criado previamente. | |
keyword.applyLabel('hot'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment