Hello,
I'm trying to change the Max CPC of a Managed Placement, but I got stuck in
the
error CRITERIA_TYPE_INVALID_FOR_BIDDING_STRATEGY_CONFIGURATION, regardless
of the alteration (getting the BiddableAdGroupCriterion and sending it back
throws the error).
We're using v201309 API's version, and we can make the alteration via UI.
We're using the following code (this is only a lab I've done to reproduce
the error):
AdWordsUser user = new AdWordsUser();
using (AdGroupCriterionService servico =
(AdGroupCriterionService)user.GetService(AdWordsService.v201309.AdGroupCriterionService))
{
servico.RequestHeader.clientCustomerId = test_clientCustomerId.ToString();
Selector selector = new Selector();
selector.fields = new string[] {
"AdGroupId", "Id", "CriterionUse", "Status", "CpcBidSource"
};
Predicate adGroupPredicate = new Predicate()
{
field = "AdGroupId",
@operator = PredicateOperator.EQUALS,
values = new string[] { test_adGroupId.ToString() }
};
Predicate keywordPredicate = new Predicate()
{
field = "Id",
@operator = PredicateOperator.EQUALS,
values = new string[] { test_keywordId.ToString() }
};
Predicate keywordStatus = new Predicate()
{
field = "Status",
@operator = PredicateOperator.IN,
values = new string[] { UserStatus.ACTIVE.ToString() }
};
Predicate criterionUsePredicate = new Predicate()
{
field = "CriterionUse",
@operator = PredicateOperator.EQUALS,
values = new string[] { CriterionUse.BIDDABLE.ToString() }
};
selector.predicates = new Predicate[] { adGroupPredicate, keywordPredicate,
keywordStatus, criterionUsePredicate };
DateRange dateRange = new DateRange()
{
min = string.Format("{0:yyyyMMdd}", DateTime.Today),
max = string.Format("{0:yyyyMMdd}", DateTime.Today)
};
selector.dateRange = dateRange;
// returns only one entry
AdGroupCriterionPage adGroupCriterionPage = servico.get(selector);
if (adGroupCriterionPage != null && adGroupCriterionPage.entries != null)
{
AdGroupCriterion adGroupCriterion = adGroupCriterionPage.entries[0];
BiddableAdGroupCriterion biddableAdGroupCriterion =
(BiddableAdGroupCriterion)adGroupCriterion;
CpcBid keywordMaxCpc = new CpcBid()
{
bid = new Money()
{
// Current CPC is 0.54, I'm trying to change to 0.53
microAmount = Convert.ToInt64(Math.Round(test_newCpc * 1000000, 2))
}
};
biddableAdGroupCriterion
.biddingStrategyConfiguration
.bids = new Bids[] { keywordMaxCpc };
// don't set any bidding strategy type
biddableAdGroupCriterion
.biddingStrategyConfiguration
.biddingStrategyType = BiddingStrategyType.NONE;
AdGroupCriterionOperation keywordOperation = new
AdGroupCriterionOperation();
keywordOperation.@operator = Operator.SET;
keywordOperation.operand = adGroupCriterion;
// throws the following exception:
//
{"[AdGroupCriterionError.CRITERIA_TYPE_INVALID_FOR_BIDDING_STRATEGY_CONFIGURATION
@ operations[0].operand.criterion]"}
AdGroupCriterionReturnValue retVal = servico.mutate(new
AdGroupCriterionOperation[] { keywordOperation });
}
}
Is there another way to change the Max CPC from Managed Placements?
Thanks in advance
Mauricio
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.