error comes when updating final ur lUrlError.DESTINATION_URL_DEPRECATED @

37 views
Skip to first unread message

caarif Ashraf

unread,
Sep 11, 2016, 12:51:43 PM9/11/16
to AdWords API Forum
Hi

I got an error when i am trying to update criteria final url using PHP api.
these are my data Array ( [keyword_id] => 11285220 [Ad_group_id] => 41568659428 [maxCPC] => 0.02 [Final_URL] =>http://cas.info/utm_term=adwords-keyword ) . I got error when try with these data. The error returned is { Âûáðîøåíî èñêëþ÷åíèå: [UrlError.DESTINATION_URL_DEPRECATED @ operations[0].operand.destinationUrl] }. Can anyone help me.
This is my code
 $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);
  echo 'Criterion selected<br />';
  // Update destination URL.
  $adGroupCriterion->destinationUrl = $final_url;
 /* 
  // Set bids (optional).
    $bid = new CpcBid();
    $bid->bid =  new Money(500000);
    $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];
  echo 'Result after updation';
  print_r($adGroupCriterion);
  printf("Keyword with ID '%s' has updated destination URL '%s'.\n",
      $adGroupCriterion->criterion->id, $adGroupCriterion->destinationUrl);

Peter Oliquino

unread,
Sep 11, 2016, 11:56:03 PM9/11/16
to AdWords API Forum
Hi Caarif,

My apologies for the delay. The DESTINATION_URL_DEPRECATED error occurs when the destinationUrl is being set, unfortunately however, this field has already been deprecated. You will need to set the finalUrls field instead. I hope this helps and please let me know if you still encounter any issues.

Best regards,
Peter
AdWords API Team  
Reply all
Reply to author
Forward
0 new messages