Lances
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Ver estratégias de lances
function getBiddingStrategies() {
const bidStrategyIterator = AdsApp.biddingStrategies().get();
return bidStrategyIterator;
}
Conferir estratégias de lances por nome
function getBiddingStrategyIteratorByName(biddingStrategyName) {
const biddingStrategiesIterator = AdsApp.biddingStrategies()
.withCondition(`bidding_strategy.name = '${biddingStrategyName}'`)
.get();
return biddingStrategiesIterator;
}
Definir estratégia de lances da campanha
function setVariousBiddingStrategies() {
// This example snippet assumes the user has a campaign named "Online Sales".
const campaignName = 'Online Sales';
const campaignIterator =
AdsApp.campaigns()
.withCondition(`campaign.name = '${campaignName}'`)
.get();
if (!campaignIterator.hasNext()) {
throw new Error(`No Campaign found with name "${campaignName}"`);
}
if (campaignIterator.totalNumEntities() > 1) {
console.warn(
`Found ${campaignIterator.totalNumEntities()} Campaigns with name "${
campaignName}", using just one of them`);
}
const campaign = campaignIterator.next();
// Set the campaign's bidding strategy to Manual CPC.
campaign.bidding().setStrategy('MANUAL_CPC');
// By default, the Manual CPC strategy enables Enhanced CPC bidding. The user
// can disable ECPC when setting the strategy by providing an extra argument.
campaign.bidding().setStrategy('MANUAL_CPC', {enhancedCpcEnabled: false});
// Some standard bidding strategies, such as Target Return on Ad Spend,
// require additional arguments when setting the strategy. Setting the
// strategy to Target Return on Ad Spend without providing the required
// additional arguments will fail.
campaign.bidding().setStrategy('TARGET_ROAS', {targetRoas: 1.3});
// Extra arguments can also be specified through the BiddingStrategyArgsBuilder.
const args =
campaign.bidding.argsBuilder().withTargetRoas(1.3).withCpcBidCeiling(2.5);
campaign.bidding().setStrategy('TARGET_ROAS', args);
// If the user has defined a flexible bidding strategy for the campaign, then
// this is also valid for `setStrategy`. For this example, assume the user
// has a flexible bidding strategy named "My Shared Bidding Strategy".
const strategyName = 'My Shared Bidding Strategy';
const strategy =
AdsApp.biddingStrategies()
.withCondition(`bidding_strategy.name = '${strategyName}'`)
.get()
.next();
campaign.bidding().setStrategy(strategy);
}
Definir o lance de CPC padrão de um grupo de anúncios
function setAdGroupDefaultCpcBid(campaignName, adGroupName){
const adGroup = AdsApp.adGroups()
.withCondition(`campaign.name = '${campaignName}'`)
.withCondition(`ad_group.name = '${adGroupName}'`)
.get()
.next();
// This bid will only be used for auction if a corresponding cpc
// bidding strategy is set to the ad group. E.g.
//
// adGroup.bidding().setStrategy('MANUAL_CPC');
adGroup.bidding().setCpc(3.0);
}
Definir o lance de CPC de uma palavra-chave
function setKeywordCpcBid(campaignName, adGroupName, keywordText, keywordMaxCpcBid) {
const keyword = AdsApp.keywords()
.withCondition(`campaign.name = '${campaignName}'`)
.withCondition(`ad_group.name = '${adGroupName}'`)
.withCondition(`ad_group_criterion.keyword.text = '${keywordText}'`)
.get()
.next();
// This bid will only be used for auction if a corresponding cpc
// bidding strategy is set to the parent ad group. E.g.
//
// adGroup.bidding().setStrategy('MANUAL_CPC');
keyword.bidding().setCpc(keywordMaxCpcBid);
}
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2024-09-12 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Não contém as informações de que eu preciso"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Muito complicado / etapas demais"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Desatualizado"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Problema na tradução"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Problema com as amostras / o código"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Outro"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Fácil de entender"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Meu problema foi resolvido"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Outro"
}]
{"lastModified": "\u00daltima atualiza\u00e7\u00e3o 2024-09-12 UTC."}
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2024-09-12 UTC."]]