Reputation: 5
I'm trying to programmatically change the max cpc with an AdWords script, but I'm getting an error. The console just says "Cannot find method moneyToMicros((class))". I cannot find any documentation about this error or any other posts about this anywhere. Was wondering if anyone knew how to get around this. Here's a small snippet of the code where the error occurs (error occurs on the line where setKeywordMaxCpc() is called):
while (adGroupIterator.hasNext())
{
var adGroup = adGroupIterator.next();
var adGroupName = adGroup.getName();
if (adGroupRegex.test(adGroupName))
{
if (adGroup.isPaused())
{
adGroup.enable();
adGroup.setKeywordMaxCpc(bidModifier);
}
}
else
{
adGroup.pause();
}
}
Upvotes: 0
Views: 275
Reputation: 499
I had the same problem and I've just resolved it! I was passing the value "null" to the function .setKeywordMaxCpc(); So I think you need to check if the variable bidModifier is null before you execute the function .setKeywordMaxCpc(bidModifier );
In my case I was using the value keyword.getFirstPageCpc() to set my bid, and in some words that value is null.
Upvotes: 1