Keyword status and max cpc are not changing !

81 views
Skip to first unread message

Shobhan Babu

unread,
Feb 5, 2015, 2:27:05 AM2/5/15
to adwor...@googlegroups.com


Hi,


I using the UpdateKeyword.php file to change the status of the keyword and maxcpc of the keyword but the changes are not reflecting in my google adwords dashboard

can you please tell me the procedure to find it out !

The file is executing but the status is not changing and amount also is not changing in dashborad.

And my code is :

$status=$_POST['stat'];
$accountid=$_POST['accid'];
$keyword=$_POST['keywords'];
$maxCPC=$_POST['maxcpc'];
$amount=$maxCPC*1000000;
$status=$_POST['stat'];
echo "status is:".$status;
//echo "cpc is:".$maxCPC;
$criterionId=$_POST['keywordid'];
$adGroupId=$_POST['groupid'];


function UpdateKeywordExample(AdWordsUser $user, $adGroupId, $criterionId) {
  // Get the service, which loads the required classes.
  $adGroupCriterionService =
      $user->GetService('AdGroupCriterionService', ADWORDS_VERSION);

  // Create ad group criterion.
  $adGroupCriterion = new BiddableAdGroupCriterion();
  $adGroupCriterion->adGroupId = $adGroupId;
  // Create criterion using an existing ID. Use the base class Criterion
  // instead of Keyword to avoid having to set keyword-specific fields.
  $adGroupCriterion->criterion = new Criterion($criterionId);
  $adGroupCriterion->userStatus = $status;
  // Update destination URL.
  //$adGroupCriterion->destinationUrl = 'http://www.example.com/new';
$bid = new CpcBid();
    $bid->bid =  new Money($amount);
    $biddingStrategyConfiguration = new BiddingStrategyConfiguration();
    $biddingStrategyConfiguration->bids[] = $bid;
    $adGroupCriterion->biddingStrategyConfiguration = $biddingStrategyConfiguration;

  // Create operation.
  $operation = new AdGroupCriterionOperation();
  $operation->operand = $adGroupCriterion;
  $operation->operator = 'SET';

  $operations = array($operation);

  // Make the mutate request.
  $result = $adGroupCriterionService->mutate($operations);

  // Display result.
  $adGroupCriterion = $result->value[0];
  printf("Keyword with ID '%s' has updated status '%s'.\n",
      $adGroupCriterion->criterion->id, $adGroupCriterion->userStatus);
}

Josh Radcliff (AdWords API Team)

unread,
Feb 9, 2015, 10:16:42 AM2/9/15
to adwor...@googlegroups.com
Hi,

A few things you may want to check:
  1. Are you setting validateOnly when sending your request? If so, the API will just validate the request, but won't actually apply your changes.
  2. What's the bidding strategy configuration type for the campaign or ad group? Per the Bidding guide, only [bids] that matches the selected biddingStrategyType will be used.
Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages