Rick,

Could I trouble you to use the "Reply to Author" function to send me the 
following:
1. full request/response log/payload with sensitive information removed
2. the PHP error

Thanks,

--
Ray Tsang (AdWords API Advisor)


On Monday, February 10, 2014 7:55:27 PM UTC-5, Rick Vugts wrote:
>
> So I created this function to set the location and language, but it 
> doesn't work. I get an error that I get too many loops (seem like a php 
> error). I don't see why it would loop. Even if I don't make it a function 
> (so there is no loop in my script) I still get that error.
>
> function setLocationAndLanguage(AdWordsUser $user, 
> $campaignId,$locationId,$languageId)
> {
>
>    // example data
>   $locationId = 2036;
>   $languageId = 1000;
>
>     $campaignCriterionService =
>      $user->GetService('CampaignCriterionService', ADWORDS_VERSION);
>     //$campaignCriteria = array();
>     
>     $location = new Location();
>     $location->id = $locationId;
>     $campaignCriterion = new CampaignCriterion($campaignId, null, 
> $location);
>     $operations[] = new CampaignCriterionOperation($campaignCriterion, 
> 'ADD');
>     
>     $language = new Language();
>     $language->id = $languageId; 
>     $campaignCriterion = new CampaignCriterion($campaignId, null, 
> $language);
>     $operations[] = new CampaignCriterionOperation($campaignCriterion, 
> 'ADD');
>     
>     // Make the mutate request.
>     $result = $campaignCriterionService->mutate($operations);
>
>     // Display results.
>     foreach ($result->value as $campaignCriterion) {
>         printf("Campaign targeting criterion with ID '%s' and type '%s' 
> was "
>             . "added.\n", $campaignCriterion->criterion->id,
>             $campaignCriterion->criterion->CriterionType);
>   }    
>     
> }
>
>
>
>
> Second question; How to easily set a budget for a campaign, without 
> creating a shared budget with a label? 
> I just want to have somtehing like $campaign->budget = 50.00; for example 
> instead of:
>  // Create the shared budget (required).
>   $budget = new Budget();
>   //$budget->name = 'Interplanetary Cruise Budget #' . uniqid();
>   $budget->name = $campaignName.' budget';
>   $budget->period = 'DAILY';
>   $budget->amount = new Money($budget);
>   $budget->deliveryMethod = $deliveryMethod;
>
>   $operations = array();
>
>   // Create operation.
>   $operation = new BudgetOperation();
>   $operation->operand = $budget;
>   $operation->operator = 'ADD';
>   $operations[] = $operation;
>
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to