Hi Ben,

I was able to replicate your issue in my test account. This was due to 
incorrect variable referencing in your code. Please see updates below in 
your PHP code (in *bold*) which works successfully on my end:

public static function runExample(AdWordsServices $adWordsServices,
      AdWordsSession $session, *$AD_GROUP_ID**, $bidModifier*) {
    *$adGroupCriterionService* =
        $adWordsServices->get($session, AdGroupCriterionService::class);

    //Create a mobile platform. The ID can be found in the documentation.
    //https://developers.google.com/adwords/api/docs/appendix/platforms
    $desktop= new Platform();
    $desktop->setId(30000); // HighEndMobile = 30001
 
    $urlPlacement = new Placement();
    $urlPlacement->setUrl('listverse.com');
    $urlPlacement->setId('XXXXXXXXXX');
 
    // Create a criterion with modified bid.
    $adGroup = new BiddableAdGroupCriterion();
    $adGroup->setAdGroupId($AD_GROUP_ID );
    $adGroup->setCriterion($urlPlacement);
    $adGroup->setBidModifier($bidModifier);

    // Create a campaign criterion operation and add it to the operations 
list.
    $operation = new AdGroupCriterionOperation();
    $operation->setOperator(Operator::SET);
    $operation->setOperand($adGroup);
    $operations = [$operation];

    // Update campaign criteria on the server.
    $results = $adGroupCriterionService->mutate($operations);

    // Print out some information about the updated campaign criterion.
    foreach ($results->getValue() as *$adGroupCriterion*) {
      printf(
          "Campaign criterion with campaign ID %d, criterion ID %d, "
              . "and type '%s' was modified with bid %.2f.\n",
          *$adGroupCriterion*->getAdGroupId(),
          *$adGroupCriterion*->getCriterion()->getId(),
          *$adGroupCriterion*->getCriterion()->getType(),
          *$adGroupCriterion*->getBidModifier());
    }
  }

Also, if you have further clarifications on this, I suggest to create a new 
forum thread so we can track your concerns better as this concern is 
already on the syntax of your code.

Thanks,
Vincent
AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/4c4c2da1-6a99-4760-9ab8-66975d5c220e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Where can I chec... bruce
    • Re: Where c... 'Vincent Racaza (AdWords API Team)' via AdWords API Forum
      • Re: Whe... bruce
        • Re:... 'Vincent Racaza (AdWords API Team)' via AdWords API Forum
          • ... bruce
            • ... 'Vincent Racaza (AdWords API Team)' via AdWords API Forum
              • ... bruce
              • ... bruce
                • ... 'Vincent Racaza (AdWords API Team)' via AdWords API Forum
                • ... bruce
                • ... 'Vincent Racaza (AdWords API Team)' via AdWords API Forum
                • ... bruce

Reply via email to