Re: How to handle RateExceededError.retryAfterSeconds in PHP v201502

2015-07-28 Thread Kristopher Windsor
Someone just asked a similar question, so I replied to that other thread: Other 
thread 

Thanks,

On Tuesday, July 28, 2015 at 6:02:34 AM UTC-7, Sarah Riddell wrote:
>
> Hi,
>
> Today i am facing *RateExceededError *on my standard account when 
> performing batch operations on single request(1000 operations in each 
> mutate request).
>
> It returns retryAfterSeconds=86400 not warning for  retryAfterSeconds=30 
> seconds for the first time after *9* success mutate calls(1000 operations 
> in each mutate request).
>
> [faultMessage=[RateExceededError  rateKey=level1_plan, rateScope=DEVELOPER, retryAfterSeconds=86400>]
>
>
> Can anyone post an proper  examplen In *PHP *to handle 
> RateExceededError.retryAfterSeconds 
> ? like the below one in Written in JAVA
>
> try {
>   ...
> } catch (ApiException e) {
>   for (ApiError error : e.getErrors()) {
> if (error instanceof RateExceededError) {
>   RateExceededError rateExceeded = (RateExceededError) error;
>   Thread.sleep(rateExceeded.getRetryAfterSeconds() * 1000);
> }
>   }
>   ...
> }
>
> Please help, it's an urgent. Thanks in advance
>
>
> Sarah Riddle
>
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/814721a1-7e14-4e95-84a7-9ecf86f7ccc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Wait and Retry logic to avoid RateExceedError in PHP

2015-07-28 Thread Kristopher Windsor
  public static function mutateEntities($adwords_user, $service_name, $ops){
$service = $adwords_user->GetService($service_name, Utils::
ADWORDS_VERSION);

$opc = count($ops);
if ($opc > 5000)
  throw new \Exception('Too many operations for ' . $service_name);

for ($iii = 0; $iii < 5; $iii++){
  RateLimiter::throttle($adwords_user->getClientCustomerId(), $opc);
  try {
$service->mutate($ops);
break;
  } catch (\Exception $e){
$errors = ( ($e instanceof \SoapFault) ? \ErrorUtils::GetApiErrors(
$e) : null);
if (!Utils::isRetriable($errors))
  throw new NonRetriableException('Non-retriable error: ' . $e->
getMessage()); // here I just check if the error seems to be due to a bad 
request and if so, do not retry
RateLimiter::reportError($adwords_user->getClientCustomerId(), $iii, 
$errors);
  }
  if ($iii + 1 == 5){
throw new \Exception('Adwords query failed after max retries. ' . $e
->getMessage());
  }
}

  }


RateLimiter:


  public static function reportError($account, $attemptNum, $errors = null){
if (!$account)
  $account = self::NO_ACCOUNT;

// determine if it is a rate limit issue
$error_types = [];
$rateScope = $rateName = null;
if ($errors)
  foreach ($errors as $i){
@$error_types[ $i->ApiErrorType ]++;
if ($i->ApiErrorType == 'RateExceededError')
  list($rateScope, $rateName) = array($i->rateScope, $i->rateName);
  }

error_log('AdwordsRateLimiter error ' . $account . ' ' . $rateScope . ' 
' . $rateName . ' ' . ($rateScope ? 'RATE LIMIT EXCEEDED' : '') . '; ' . 
json_encode($error_types) );

if ($rateScope && $rateName){
  $data = array('account' => $account, 'err' => '1', 'attemptNum' => 
$attemptNum, 'rateScope' => $rateScope, 'rateName' => $rateName);
} else {
  $data = array('account' => $account, 'err' => '1', 'attemptNum' => 
$attemptNum);
}
// log $data: self::sendRequest($data);
  }


^^ Here is some code we use for handling errors. While I don't check for 
retryAfterSeconds, hopefully you can see where that field might be in the 
error objects.

Hope it helps.

Thanks,


On Tuesday, July 28, 2015 at 11:53:32 AM UTC-7, faisal hossain wrote:
>
> Hi, 
>
> I am getting RateExceedError when tring to make large operations in one 
> mutate request (1000 operations in 1 mutate call), the API expert suggests 
> to honor the retryAfterSeconds=86400 
>
> Can anyone give me the example error handling code for PHP?? 
>
> It's very urgent. Thanks in advance 
>
> Cheers 
> Faisal Hossain

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ef2de9c1-4265-47d7-8933-a1bc1e56365b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: RateExceededError keep

2015-07-23 Thread Kristopher Windsor
We mainly do these things:

   - Report queries
   ReportDownloadError.ERROR_GETTING_RESPONSE_FROM_BACKEND
   - Entity / read-only queries to get campaigns, ads, etc
   InternalApiError.UNEXPECTED_INTERNAL_API_ERROR
   - Submit CPC bids in batch
   --> This seems to work OK
   
Thanks,
On Thursday, July 23, 2015 at 11:39:11 AM UTC-7, Eric Berry wrote:
>
> I'm seeing this when using the TargetingIdeaService
>
> On Thursday, July 23, 2015 at 11:25:29 AM UTC-6, Michael Cloonan (AdWords 
> API Team) wrote:
>>
>> Hello again,
>>
>> One other followup question. For users this is affecting, is it 
>> specifically only affecting reporting, or are you also seeing this behavior 
>> with other services?
>>
>> Regards,
>> Mike, AdWords API Team
>>
>> On Thursday, July 23, 2015 at 1:15:54 PM UTC-4, Michael Cloonan (AdWords 
>> API Team) wrote:
>>>
>>> Hello,
>>>
>>> Everyone who is experiencing this issues, please reply to me privately 
>>> with your developer token and CID so that we can narrow down and take a 
>>> closer look at specifically known affected accounts. The engineering team 
>>> is actively looking into this issue.
>>>
>>> Regards,
>>> Mike, AdWords API Team
>>>
>>> On Thursday, July 23, 2015 at 9:41:57 AM UTC-4, Michael Cloonan (AdWords 
>>> API Team) wrote:
>>>>
>>>> Thanks everyone for the reports. I've filed a bug with our engineering 
>>>> team to look into this issue, and I will keep this thread updated as I 
>>>> hear 
>>>> back.
>>>>
>>>> Regards,
>>>> Mike, AdWords API Team
>>>>
>>>> On Thursday, July 23, 2015 at 9:38:28 AM UTC-4, Justin Coon wrote:
>>>>>
>>>>> Let me also add that our analytics tool has been working without this 
>>>>> issue for at least 6 months as well. No changes on our end, but this just 
>>>>> started happening within the last few days. We download reports, and make 
>>>>> a 
>>>>> few read-only calls related to account structure, campaigns, and ads.
>>>>>
>>>>> Thanks
>>>>> Justin
>>>>>
>>>>> On Thursday, July 23, 2015 at 8:34:23 AM UTC-5, uvsuperDev wrote:
>>>>>>
>>>>>> Hello Michael,
>>>>>> We are well aware to the rate limits and we have implemented all your 
>>>>>> best practices (using mutateJobService, waits etc.). As I have written 
>>>>>> on 
>>>>>> my original post we keep getting this after the 24 hours penalty after 
>>>>>> making another 15-20 calls within a hour (that isn't too much, right?).
>>>>>>
>>>>>> I am really suspecting that something has gone wrong on your end 
>>>>>> since our tool was working perfectly for months. 
>>>>>>
>>>>>> Any other solutions? Is there a way to find our the exact reason we 
>>>>>> get this error?
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>> On Thursday, July 23, 2015 at 4:21:42 PM UTC+3, Michael Cloonan 
>>>>>> (AdWords API Team) wrote:
>>>>>>>
>>>>>>> Hello Kristopher,
>>>>>>>
>>>>>>> Based on the number of reports, and your description, I am starting 
>>>>>>> to suspect like you that something may be wrong on our end. Can you 
>>>>>>> please 
>>>>>>> reply to me privately and include an example SOAP request/response 
>>>>>>> where 
>>>>>>> you're getting the rate limiting error at a time where you normally 
>>>>>>> wouldn't have? I will pass it along to the engineers so that they can 
>>>>>>> look 
>>>>>>> at a specific example to see what might be going wrong.
>>>>>>>
>>>>>>> Regards,
>>>>>>> Mike, AdWords API Team
>>>>>>>
>>>>>>> On Wednesday, July 22, 2015 at 2:05:37 PM UTC-4, Kristopher Windsor 
>>>>>>> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> I am also seeing this error. Our application has been running for 
>>>>>>>> months without major changes, and we just noticed many rate exceeded 
>>>>>>>> errors 
>>>

Re: RateExceededError keep

2015-07-22 Thread Kristopher Windsor

I am also seeing this error. Our application has been running for months 
without major changes, and we just noticed many rate exceeded errors 
starting yesterday. We have a token bucket implementation, exponential 
back-off strategy, everything that was recommended. I think something has 
changed on Google's end.

We are also seeing many unexpected internal API errors (more than usual) -- 
these errors are persistent enough that our scripts give up retrying. (This 
is not usual.)

 [RateExceededError ]"



On Wednesday, July 22, 2015 at 9:57:22 AM UTC-7, Justin Coon wrote:
>
> Is it possible to get a grace extension for a day or so to remove the 24hr 
> ban while I put more logic to handle the more transient rate limit errors 
> and deploy that code? I've already changed through our config file to 
> download reports on a less often interval so that should help alot, but I 
> need more logic to better handle the 'warning' 30 second timeouts
> On Jul 22, 2015 11:44 AM, "Justin Coon"  > wrote:
>
>> Does the clock reset the 24 hrs every time a subsequent request is made 
>> (the request obviously still fails)?
>>
>> On Wednesday, July 22, 2015 at 11:30:10 AM UTC-5, Michael Cloonan 
>> (AdWords API Team) wrote:
>>>
>>> Hello Justin,
>>>
>>> If you adhere to the timeouts specified in the rate limit errors, you 
>>> will never be locked out for an entire day. Rate limits apply to all 
>>> accounts, and they're enforced to make sure that one user cannot prevent 
>>> the ability of another to use the API. You must honor the returned wait 
>>> times specified by rate limits in order to make sure that your software 
>>> does not get this last-resort 24 hour penalty. This penalty generally isn't 
>>> issued the very first time you try to make a request that is rejected due 
>>> to rate limit issues; you need to keep ignoring the errors and trying again 
>>> before the specified time in order to get locked out for so long.
>>>
>>> Once you implement wait and retry logic, you should never get locked out 
>>> for more than a few minutes, or probably even less than that.
>>>
>>> Regards,
>>> Mike, AdWords API Team
>>>
>>> On Wednesday, July 22, 2015 at 11:28:36 AM UTC-4, Justin Coon wrote:

 We have been dealing with the exact same thing. But this seems really 
 silly that we stop making requests for 24hrs. Basically that requires to 
 stop our software completely...which effects our customers. So every time 
 we make a subsequent request (after the initial error) the clock starts 
 over??! We will never get back to ground zero
>>>
>>>  -- 
>> -- 
>> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
>> 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 adwor...@googlegroups.com 
>> 
>> To unsubscribe from this group, send email to
>> adwords-api...@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 a topic in the 
>> Google Groups "AdWords API Forum" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/adwords-api/FRfQrbD2csE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> adwords-api...@googlegroups.com .
>> Visit this group at http://groups.google.com/group/adwords-api.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/adwords-api/cab0cf01-0d47-44a0-ba2d-b8e96a91fb46%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
On Wednesday, July 22, 2015 at 9:57:22 AM UTC-7, Justin Coon wrote:
>
> Is it possible to get a grace extension for a day or so to remove the 24hr 
> ban while I put more logic to handle the more transient rate limit errors 
> and deploy that code? I've already changed through our config file to 
> download reports on a less often interval so that should help alot, but I 
> need more logic to better handle the 'warning' 30 second timeouts
> On Jul 22, 2015 11:44 AM, "Justin Coon"  > wrote:
>
>> Does the clock reset the 24 hrs every time a subsequent request is made 
>> (the request obviously still fails)?
>>
>> On Wednesday, July 22, 2015 at 11:30:10 AM UTC-5, Michael Cloonan 
>> (AdWords API Team) wrote:
>>>
>>> Hello Justin,
>>>
>>> If you adhere to the timeouts specified in the rate limit errors, you 
>>> will never be locked out for an entire day. Rate limits apply to all 
>>> accounts, and they're enforced to make sure that one user cannot prevent 
>>> the ability of another to use

How to Get Reach Estimate Through the API?

2015-07-13 Thread Kristopher Windsor
Hi,

In the Adwords UI, "you can see an estimate of impressions available per 
week on the Google Display Network for your ad group" (see below link).

https://support.google.com/adwords/answer/2475441?hl=en

The above page says: "The estimates you see don't represent the actual 
traffic your ads will get. Instead, they represent the potential number of 
impressions available for any advertiser using the settings and targeting 
options that you've selected for your ad group."

Question is, how can I get this data from the API? If I understand right, 
this data is different from the TrafficEstimatorService (which estimates 
traffic available to a campaign, not the total volume that exists).

Thanks,

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/04190c14-0fcb-4107-bd70-1a8c6fcda7be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Lots of 502 bad gateway errors

2015-06-09 Thread Kristopher Windsor
Hi, I am seeing this error much more than usual, starting sometime in the 
last 2-3 weeks:


SOAP-ERROR: Parsing WSDL: Couldn't load from 
> 'https:\/\/adwords.google.com\/api\/adwords\/cm\/v201502\/AdGroupService?wsdl'
>  
> : failed to load external entity 
> \"https:\/\/adwords.google.com\/api\/adwords\/cm\/v201502\/AdGroupService?wsdl


Is this error possibly related?

Thanks, 

On Monday, June 8, 2015 at 10:46:47 AM UTC-7, Nadine Sundquist (AdWords API 
Team) wrote:
>
> Hi Ashley,
>
> There are no updates, yet. I'll let you know as soon as I hear anything.
>
> Thanks,
> Nadine, AdWords API Team
>
> On Saturday, June 6, 2015 at 12:50:23 PM UTC-4, Ashley Xu wrote:
>>
>> Hi,
>>
>> Did we have any update on this? We are still seeing the issue but it just 
>> happened less frequently.
>>
>> Thanks
>> Ashley
>>
>> On Monday, June 1, 2015 at 5:41:56 PM UTC-7, Ashley Xu wrote:
>>
>>> Hi,
>>>
>>> We have seen a lot of 502 bad gateway errors recently. Please find below 
>>> the stack trace and the number of failures per day. Could you please help 
>>> take a look?
>>>
>>> Thanks
>>> Ashley
>>>
>>> Sync error: WebExceptionProtocolError ---> System.Net.WebException: The 
>>> request failed with HTTP status 502: Bad Gateway.
>>>at 
>>> System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
>>>  
>>> message, WebResponse response, Stream responseStream, Boolean asyncCall)
>>>at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String 
>>> methodName, Object[] parameters)
>>>at Google.Api.Ads.Common.Lib.AdsSoapClient.MakeApiCall(String 
>>> methodName, Object[] parameters)
>>>at Google.Api.Ads.AdWords.v201409.ManagedCustomerService.get(Selector 
>>> serviceSelector)
>>>
>>>*LogDate*
>>> *NumFailures*5/1/201525/2/201515/3/201515/4/201535/4/201565/4/201516
>>> 5/12/201545/12/201595/12/2015235/13/201515/13/2015105/14/201545/18/20151
>>> 5/18/201525/19/201515/19/201535/19/201535/20/201515/20/201535/21/20152
>>> 5/26/201515/26/201515/27/201515/27/201545/28/201565/28/201575/29/201535
>>> 5/29/2015385/30/201565/30/20155
>>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a0d7be4d-022d-4668-ba3e-50a4469fbbcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


"Google Analytics column titles have been updated to match the Adwords user interface" 201502 migration

2015-05-01 Thread Kristopher Windsor
Hi,

In the migration guide to Adwords API v201502, I see:

Google Analytics column titles have been updated to match the Adwords user 
> interface
>

What is this referring to?

Thanks, 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/62e0ca81-0155-4c33-bf0c-db80fa0b1623%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


AD_PERFORMANCE_REPORT vs Display Ads in "Ads in mobile apps" campaigns

2015-04-08 Thread Kristopher Windsor
Hi,

I have found that Display Ads -- the ads in campaigns with subtype "Ads in 
mobile apps" -- do not appear correctly in this report.

I am using the AD_PERFORMANCE_REPORT report via v201409, php, CSV format.

   - Text Display Ads -- the headline is:  
*Display Ad created 9/15/14 - Play With Millions *Instead of just:
   *Play With Millions*
   - Image Display Ads -- the Ad type is blank (not "Image ad" or "Display 
   ad")

Is this expected? How should I get the actual headline for text Display 
ads, and figure out which ads are image Display ads?

Thanks,

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d4019551-c2df-4f3e-86da-4390ed0db684%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Namespace for PHP Client Library

2014-11-24 Thread Kristopher Windsor
Hi,

The Adwords API PHP client library defines, among other things, a class 
named "Logger" in the global namespace that will conflict with another 
Logger class we want to use.
Is there an easy way to put all of the client library code into a namespace 
to avoid the class name collision?

In AdsUser.php:
require_once 'Google/Api/Ads/Common/Util/Logger.php';


/**
 * A logger class which registers appenders (any writable handle location
 * which can be fopen'ed) with a unique name for that log. The library will
 * write all incoming/outgoing SOAP XML to SOAP_XML_LOG and
 * all records of requests to REQUEST_INFO_LOG.
 *
 * Currently, levels are only used as indicators (there is no filtering
 * mechanism as of yet).
 *
 * A list of supported appenders (file handles) can be found here:
 * {@link http://us2.php.net/manual/en/wrappers.php}
 *
 * @package GoogleApiAdsCommon
 * @subpackage Util
 */
class Logger {



Thanks,

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/bb0abed9-7dea-4673-98e5-8f136f62005b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Which API errors should be retried?

2014-11-20 Thread Kristopher Windsor
Thanks Michael and Oliver.

I want the default to be "do retry," and I wrote this today (PHP):

  public static function isRetriable($e){
if ($e instanceof SoapFault && @$e->detail->ApiExceptionFault->errors[0
]->enc_value instanceof ApiError){
  $err = $e->detail->ApiExceptionFault->errors[0]->enc_value;
  if ($err instanceof ApiError){
// ie CRITERIA_TYPE_INVALID_FOR_BIDDING_STRATEGY_CONFIGURATION
if ($err->ApiErrorType == 'AdGroupCriterionError')
  return false;
// ie INVALID_FORMAT_FOR_PLACEMENT_URL
if ($err->ApiErrorType == 'CriterionError')
  return false;
  }
}
return true;
  }

I don't plan to handle all of the possible errors, just the ones I know we 
waste time retrying.

My main question is... should I be inspecting SoapFault this closely?
It seems like it is tedious to find the actual instances of ApiError within 
SoapFault.

On Tuesday, November 18, 2014 1:35:34 PM UTC-8, Kristopher Windsor wrote:
>
> Hi,
>
> When the Adwords API throws an Exception, I'd like to know if I should 
> retry (intermittent errors) or not (bad input on my end).
> I am using the PHP client library.
>
> For example, I should retry for this case:
> InternalApiError.UNEXPECTED_INTERNAL_API_ERROR
>
> But not for this case:
> BiddingError.BID_TOO_MANY_FRACTIONAL_DIGITS
>
> Is there some way to determine if I should retry, other than just building 
> a big list of retry-able / non-retry-able Exceptions?
>
> Thanks,
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/8802838e-c187-48c5-9079-7f478313c2b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Which API errors should be retried?

2014-11-18 Thread Kristopher Windsor
Hi,

When the Adwords API throws an Exception, I'd like to know if I should 
retry (intermittent errors) or not (bad input on my end).
I am using the PHP client library.

For example, I should retry for this case:
InternalApiError.UNEXPECTED_INTERNAL_API_ERROR

But not for this case:
BiddingError.BID_TOO_MANY_FRACTIONAL_DIGITS

Is there some way to determine if I should retry, other than just building 
a big list of retry-able / non-retry-able Exceptions?

Thanks,

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0e069f7c-1a42-40b0-964f-572623389543%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Placement Performance Report isRestrict

2014-10-29 Thread Kristopher Windsor
Thanks! That makes sense. And I see that this setting is applied per 
adgroup per criterion type, rather than per criterion.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ba1bb501-152b-4c38-a540-abbe5e951e36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: is it possible via API v201409 to set a campaign sub-type , and how?

2014-10-29 Thread Kristopher Windsor
>From the release notes:
https://developers.google.com/adwords/api/docs/reference/

Mobile campaigns for search and display
>
> Search Mobile App and Display Mobile App campaign subtypes 
> 
>  
> are now available via CampaignService. These new subtypes are a simplified 
> way of creating campaigns focused on mobile app promotion 
> 
> .
>

And from the docs:


AdvertisingChannelSubType 
> 
>  
> - 
> Optional refinement of advertisingChannelType. Must be a valid sub-type of 
> the parent channel type. May only be set for new campaigns and cannot be 
> changed once set. This field can be selected using the value 
> "AdvertisingChannelSubType". This field can be filtered on. This field is 
> read only and will be ignored when sent to the API for the following 
> Operator 
> s:
>  
> SET.


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/196aca5d-254c-4ebb-8373-c51d1157841e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Click through rate bigger the 100%

2014-10-29 Thread Kristopher Windsor
I have seen what is probably the same issue in the Adwords UI, where for a 
particular placement, I can get 1 impressions 3 clicks for example.


On Tuesday, October 28, 2014 3:27:30 PM UTC-7, Luca Fiaschi wrote:
>
> Hi,
> Pulling a keyword performance report
>
>SELECT  Clicks, Conversions, Cost, ConversionValue,Impressions, Id, 
> KeywordText, Ctr,
> AdGroupName, AccountDescriptiveName, MaxCpc, AverageCpc
> FROM KEYWORDS_PERFORMANCE_REPORT
> WHERE Id != 300 AND Id != 306 AND Impressions > 0 AND 
> AdGroupStatus=ENABLED AND CampaignStatus=ENABLED AND Status=ENABLED
> DURING 20140926, 20141026
>
>
> I noticed several keywords with CTR above 100% (even 200%) how is this 
> possible?
>
> I tried to compute ctr as click/impression and the value returned by the 
> API and both are the same: which means impressions below the number of 
> clicks ! 
>
>
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/3676a7bc-5410-4cee-8dc3-afa3f8b3d87c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to use skipReportSummary in PHP Client Library?

2014-10-29 Thread Kristopher Windsor
Hi,

I see the new Adwords version allows a skipReportSummary setting for 
reports. How can I set this field in the PHP Client library?
I do not see a reference to it in the ReportDefinition class.

Thanks,

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/3d12ca49-d792-4e72-8858-300da89ded10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Placement Performance Report isRestrict

2014-10-29 Thread Kristopher Windsor
Hi,

I cannot figure out from the documentation what the intended use of 
isRestrict is for this report, PLACEMENT_PERFORMANCE_REPORT.

The docs say:


Use the isRestrict column to distinguish between placements you target vs. 
> placements only used for bidding.
>
And:

Defines if criterion is used for targeting (true) or bidding only (false).


Does this refer to positive vs negative criteria, or to automatic vs 
managed placements, or maybe to positive criterion with a specified bid vs 
positive criterion without a specified bid?

Thanks,

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/7f2221e5-8fc5-43ec-8051-fefa7866ea21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fault occurred while processing - BiddableAdGroupCriterion [v201402] [PHP]

2014-10-02 Thread Kristopher Windsor
Nevermind, I found the error. I was doing:

new AdGroupCriterionOperation($op, 'SET')

But AdGroupCriterionOperation does not take a second parameter like 
AdGroupOperation, so operator was null.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a28596f1-ec77-4d9a-b0ae-359715ecf167%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fault occurred while processing - BiddableAdGroupCriterion [v201402] [PHP]

2014-10-02 Thread Kristopher Windsor
Or without catching the original Exception, the stack trace is:
Fatal error: Uncaught SoapFault exception: [soap:Server] Fault occurred 
while processing. in /code/bidder/lib/legacy/adwords/Google/Api/Ads/Common/
Lib/AdsSoapClient.php:232
Stack trace:
#0 
/code/bidder/lib/legacy/adwords/Google/Api/Ads/Common/Lib/AdsSoapClient.php(232):
 
SoapClient->__soapCall('mutate', Array, NULL, Array, Array)
#1 
/code/bidder/lib/legacy/adwords/Google/Api/Ads/AdWords/v201402/AdGroupCriterionService.php(8896):
 
AdsSoapClient->__soapCall('mutate', Array)
#2 /code/bidder/lib/adwords/AdwordsCampaignAPI.php(306): 
AdGroupCriterionService->mutate(Array)
...


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/24d83b38-76f6-4069-b741-3ed145441255%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fault occurred while processing - BiddableAdGroupCriterion [v201402] [PHP]

2014-10-02 Thread Kristopher Windsor
Or without catching the original Exception, the stack trace is:

Fatal error: Uncaught SoapFault exception: [soap:Server] Fault occurred 
while processing. in /code/bidder/lib/legacy/adwords/Google/Api/Ads/Common/
Lib/AdsSoapClient.php:232
Stack trace:
#0 
/code/bidder/lib/legacy/adwords/Google/Api/Ads/Common/Lib/AdsSoapClient.php(232):
 
SoapClient->__soapCall('mutate', Array, NULL, Array, Array)
#1 
/code/bidder/lib/legacy/adwords/Google/Api/Ads/AdWords/v201402/AdGroupCriterionService.php(8896):
 
AdsSoapClient->__soapCall('mutate', Array)
#2 /code/bidder/lib/adwords/AdwordsCampaignAPI.php(306): 
AdGroupCriterionService->mutate(Array)...



On Thursday, October 2, 2014 6:03:02 PM UTC-7, Kristopher Windsor wrote:
>
> Hi,
>
> I am querying for BiddableAdGroupCriterion, changing the 
> biddingStrategyConfiguration on each criterion, and then trying to send the 
> changes to Adwords. I get this same error regardless if operator is ADD or 
> SET.
> How can I fix this?
>
> Thanks,
>
> Code:
>   public static function mutateEntities($adwords_user, $campaign_name, 
> $service_name, $ops){
> $service = $adwords_user->GetService($service_name, ADWORDS_VERSION);
>
> $opc = count($ops);
> if ($opc > 5000)
>   throw new Exception('Too many operations for ' . $service_name);
>
> for ($iii = 0; $iii < AdwordsRateLimiter::TOTAL_RETRIES; $iii++){
>   AdwordsRateLimiter::throttle($adwords_user->getClientCustomerId(), 
> $opc);
>   try {
> $service->mutate($ops);
> break;
>   } catch (RateExceededError $e){
> AdwordsRateLimiter::reportError($adwords_user->getClientCustomerId
> (), $e->rateScope, $e->rateName);
>   } catch (Exception $e ){
> AdwordsRateLimiter::reportError($adwords_user->getClientCustomerId
> ());
>   }
>   if ($iii + 1 == AdwordsRateLimiter::TOTAL_RETRIES){
> echo ADWORDS_VERSION . "\n";
> var_dump($ops);
> throw new Exception('Adwords query failed after max retries. ' . 
> $e->getMessage());
>   }
> }
>
>   }
>
> Output:
> v201402
> array(1) {
>   [0]=>
>   object(AdGroupCriterionOperation)#17657 (5) {
> ["operand"]=>
> object(BiddableAdGroupCriterion)#17669 (18) {
>   ["userStatus"]=>
>   string(6) "ACTIVE"
>   ["systemServingStatus"]=>
>   NULL
>   ["approvalStatus"]=>
>   NULL
>   ["disapprovalReasons"]=>
>   NULL
>   ["destinationUrl"]=>
>   NULL
>   ["experimentData"]=>
>   NULL
>   ["firstPageCpc"]=>
>   NULL
>   ["topOfPageCpc"]=>
>   NULL
>   ["qualityInfo"]=>
>   NULL
>   ["biddingStrategyConfiguration"]=>
>   object(BiddingStrategyConfiguration)#20173 (6) {
> ["biddingStrategyId"]=>
> NULL
> ["biddingStrategyName"]=>
> NULL
> ["biddingStrategyType"]=>
> string(10) "MANUAL_CPC"
> ["biddingStrategySource"]=>
> NULL
> ["biddingScheme"]=>
> NULL
> ["bids"]=>
> array(1) {
>   [0]=>
>   object(CpcBid)#20175 (5) {
> ["bid"]=>
> object(Money)#20176 (3) {
>   ["microAmount"]=>
>   int(37)
>   ["ComparableValueType"]=>
>   NULL
>   ["_parameterMap":"ComparableValue":private]=>
>   array(1) {
> ["ComparableValue.Type"]=>
> string(19) "ComparableValueType"
>   }
> }
> ["contentBid"]=>
> NULL
> ["cpcBidSource"]=>
> NULL
> ["BidsType"]=>
> NULL
> ["_parameterMap":"Bids":private]=>
> array(1) {
>   ["Bids.Type"]=>
>   string(8) "BidsType"
> }
>   }
> }
>   }
>   ["bidModifier"]=>
>   NULL
>   ["adGroupId"]=>
>   string(11) "17363429715"
>   ["stats"]=>
>   NULL
>   ["criterionUse"]=>
>   string(8) "BIDDABLE"
>   ["criterion"]=>
>   

Fault occurred while processing - BiddableAdGroupCriterion [v201402] [PHP]

2014-10-02 Thread Kristopher Windsor
Hi,

I am querying for BiddableAdGroupCriterion, changing the 
biddingStrategyConfiguration on each criterion, and then trying to send the 
changes to Adwords. I get this same error regardless if operator is ADD or 
SET.
How can I fix this?

Thanks,

Code:
  public static function mutateEntities($adwords_user, $campaign_name, 
$service_name, $ops){
$service = $adwords_user->GetService($service_name, ADWORDS_VERSION);

$opc = count($ops);
if ($opc > 5000)
  throw new Exception('Too many operations for ' . $service_name);

for ($iii = 0; $iii < AdwordsRateLimiter::TOTAL_RETRIES; $iii++){
  AdwordsRateLimiter::throttle($adwords_user->getClientCustomerId(), 
$opc);
  try {
$service->mutate($ops);
break;
  } catch (RateExceededError $e){
AdwordsRateLimiter::reportError($adwords_user->getClientCustomerId
(), $e->rateScope, $e->rateName);
  } catch (Exception $e ){
AdwordsRateLimiter::reportError($adwords_user->getClientCustomerId
());
  }
  if ($iii + 1 == AdwordsRateLimiter::TOTAL_RETRIES){
echo ADWORDS_VERSION . "\n";
var_dump($ops);
throw new Exception('Adwords query failed after max retries. ' . $e
->getMessage());
  }
}

  }

Output:
v201402
array(1) {
  [0]=>
  object(AdGroupCriterionOperation)#17657 (5) {
["operand"]=>
object(BiddableAdGroupCriterion)#17669 (18) {
  ["userStatus"]=>
  string(6) "ACTIVE"
  ["systemServingStatus"]=>
  NULL
  ["approvalStatus"]=>
  NULL
  ["disapprovalReasons"]=>
  NULL
  ["destinationUrl"]=>
  NULL
  ["experimentData"]=>
  NULL
  ["firstPageCpc"]=>
  NULL
  ["topOfPageCpc"]=>
  NULL
  ["qualityInfo"]=>
  NULL
  ["biddingStrategyConfiguration"]=>
  object(BiddingStrategyConfiguration)#20173 (6) {
["biddingStrategyId"]=>
NULL
["biddingStrategyName"]=>
NULL
["biddingStrategyType"]=>
string(10) "MANUAL_CPC"
["biddingStrategySource"]=>
NULL
["biddingScheme"]=>
NULL
["bids"]=>
array(1) {
  [0]=>
  object(CpcBid)#20175 (5) {
["bid"]=>
object(Money)#20176 (3) {
  ["microAmount"]=>
  int(37)
  ["ComparableValueType"]=>
  NULL
  ["_parameterMap":"ComparableValue":private]=>
  array(1) {
["ComparableValue.Type"]=>
string(19) "ComparableValueType"
  }
}
["contentBid"]=>
NULL
["cpcBidSource"]=>
NULL
["BidsType"]=>
NULL
["_parameterMap":"Bids":private]=>
array(1) {
  ["Bids.Type"]=>
  string(8) "BidsType"
}
  }
}
  }
  ["bidModifier"]=>
  NULL
  ["adGroupId"]=>
  string(11) "17363429715"
  ["stats"]=>
  NULL
  ["criterionUse"]=>
  string(8) "BIDDABLE"
  ["criterion"]=>
  object(MobileApplication)#17661 (6) {
["appId"]=>
string(26) "2-"
["displayName"]=>
string(73) ""
["id"]=>
string(11) ""
["type"]=>
string(18) "MOBILE_APPLICATION"
["CriterionType"]=>
string(17) "MobileApplication"
["_parameterMap":"Criterion":private]=>
array(1) {
  ["Criterion.Type"]=>
  string(13) "CriterionType"
}
  }
  ["forwardCompatibilityMap"]=>
  NULL
  ["AdGroupCriterionType"]=>
  string(24) "BiddableAdGroupCriterion"
  ["_parameterMap":"AdGroupCriterion":private]=>
  array(1) {
["AdGroupCriterion.Type"]=>
string(20) "AdGroupCriterionType"
  }
}
["exemptionRequests"]=>
string(3) "ADD"
["operator"]=>
NULL
["OperationType"]=>
NULL
["_parameterMap":"Operation":private]=>
array(1) {
  ["Operation.Type"]=>
  string(13) "OperationType"
}
  }
}

Fatal error: Uncaught exception 'Exception' with message 'Adwords query 
failed after max retries. Fault occurred while processing.' in...


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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...@g

How to create campaign that will show up as "Mobile app installs" in Adwords UI?

2014-09-08 Thread Kristopher Windsor
In the Adwords UI there is this campaign subtype "Mobile app installs," and 
if you choose it, you select one mobile app that is tied to the campaign.

In the API, I see nothing to differentiate campaign subtypes "Mobile app 
installs" from "Ads in mobile apps," and no way to tie a mobile app to a 
campaign. Are campaign subtypes just UI-specific constructs that I should 
ignore on the API side?

Thanks,

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/012069fb-a1a4-47ac-82e3-d9b2d6f91eff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add OPERATING_SYSTEM_VERSION criterion to campaign [PHP] [v201402]

2014-07-29 Thread Kristopher Windsor
Thanks, the ConstantDataService is what I was missing. I wish either the 
Criterion pages or the Appendix had mentioned that service.

On Monday, July 28, 2014 1:41:06 PM UTC-7, Josh Radcliff (AdWords API Team) 
wrote:
>
> Hi,
>
> You can only pass specific predefined *OperatingSystemVersion* objects, 
> identified by ID. To get the list of available objects and their IDs, 
> please use ConstantDataService.getOperatingSystemVersionCriterion 
> <https://developers.google.com/adwords/api/docs/reference/v201406/ConstantDataService#getOperatingSystemVersionCriterion>
> .
>
> Cheers,
> Josh, AdWords API Team
>
> On Monday, July 28, 2014 3:53:26 PM UTC-4, Kristopher Windsor wrote:
>>
>> Hi,
>>
>> I would like to apply an OperatingSystemVersion criterion to a campaign. 
>> The code below does not work because I create a criterion, but it does not 
>> have an ID.
>>
>>
>>   public function doOSVersionCriterion($campaign){
>> $campaignCriterionService = $this->user->GetService(
>> 'CampaignCriterionService', ADWORDS_VERSION);
>> 
>> $os = new OperatingSystemVersion('OS test 1', $this->params['osmajor'
>> ], $this->params['osminor'], 'GREATER_THAN_EQUAL_TO');
>>
>> $op = new CampaignCriterionOperation();
>> $op->operator = 'ADD';
>> $op->operand = new CampaignCriterion($campaign->id, null, $os);
>>
>> // Send request.
>> $result = $campaignCriterionService->mutate( array($op) );
>>   }
>>
>>
>> Result:
>>
>> *Fatal error*:  Uncaught SoapFault exception: [soap:Server] 
>> [RequiredError.REQUIRED @ operations[0].operand.criterion.id] in 
>> /code/bidder/lib/legacy/adwords/Google/Api/Ads/Common/Lib/AdsSoapClient.
>> php:232
>> Stack
>>  trace: ... in 
>> */code/bidder/lib/legacy/adwords/Google/Api/Ads/Common/Lib/AdsSoapClient.php*
>>  
>> on line *232*
>>
>> I did find "Appendix A: Criteria Codes 
>> <https://developers.google.com/adwords/api/docs/appendix/mobileplatforms>" 
>> in the docs, and it lists some criteriaId, ie. iOS=630153. But it 
>> doesn't list the criteriaId for (in example) iOS >= 5.0. I am not sure how 
>> to apply such criterion, where I specify the minimum OS version.
>>
>>
>> Thanks,
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/d/optout.


How to add OPERATING_SYSTEM_VERSION criterion to campaign [PHP] [v201402]

2014-07-28 Thread Kristopher Windsor
Hi,

I would like to apply an OperatingSystemVersion criterion to a campaign. 
The code below does not work because I create a criterion, but it does not 
have an ID.


  public function doOSVersionCriterion($campaign){
$campaignCriterionService = $this->user->GetService(
'CampaignCriterionService', ADWORDS_VERSION);

$os = new OperatingSystemVersion('OS test 1', $this->params['osmajor'], 
$this->params['osminor'], 'GREATER_THAN_EQUAL_TO');

$op = new CampaignCriterionOperation();
$op->operator = 'ADD';
$op->operand = new CampaignCriterion($campaign->id, null, $os);

// Send request.
$result = $campaignCriterionService->mutate( array($op) );
  }


Result:

*Fatal error*:  Uncaught SoapFault exception: [soap:Server] 
[RequiredError.REQUIRED @ operations[0].operand.criterion.id] in 
/code/bidder/lib/legacy/adwords/Google/Api/Ads/Common/Lib/AdsSoapClient.php:
232
Stack
 trace: ... in 
*/code/bidder/lib/legacy/adwords/Google/Api/Ads/Common/Lib/AdsSoapClient.php* 
on line *232*

I did find "Appendix A: Criteria Codes 
" 
in the docs, and it lists some criteriaId, ie. iOS=630153. But it doesn't 
list the criteriaId for (in example) iOS >= 5.0. I am not sure how to apply 
such criterion, where I specify the minimum OS version.


Thanks,

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/d/optout.