Re: 'ReflectionException' while using ReportUtils in Adwords API v201605

2016-08-16 Thread Foluso Ogunlana
Oh wow okay.

That's great, thank you very much!

It's great that it gives a helpful error, maybe it could be improved if the
message could bubble up enough to be in the stack trace?

I say this because I spent a lot of time hunting it down, and if I had seen
a single ZERO_IMPRESSIONS_NOT_SUPPORTED, it would have been obvious to me.

I can imagine other developers running into that.

Perhaps I just missed the error message and I should be looking somewhere
else?

Thanks
Foluso



On Tue, Aug 16, 2016 at 6:06 PM 'Shwetha Vastrad (AdWords API Team)' via
AdWords API Forum <adwords-api@googlegroups.com> wrote:

> Hi,
>
> Search Query Performance Report
> <https://developers.google.com/adwords/api/docs/appendix/reports/search-query-performance-report>
>  doesn't
> support zero impressions. Setting the includeZeroImpressions header to true
> will result in ReportDownloadError.ZERO_IMPRESSIONS_REQUEST_NOT_SUPPORTED
> <https://developers.google.com/adwords/api/docs/guides/zero-impression-reports#explicitly_including_zero_impressions>.
> This is most likely the reason for the exception you encountered.
>
> Regards,
> Shwetha, 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 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 a topic in the
> Google Groups "AdWords API Forum" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/adwords-api/QbZ5pe4sTeA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> adwords-api+unsubscr...@googlegroups.com.
> 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/0941eab0-0930-4918-84d4-f87505837d7a%40googlegroups.com
> <https://groups.google.com/d/msgid/adwords-api/0941eab0-0930-4918-84d4-f87505837d7a%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/CAGSMpfnbPyqghzLdh4%3DjwwfXFpCdJypW7fqYust-kzNbw7n3MQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 'ReflectionException' while using ReportUtils in Adwords API v201605

2016-08-16 Thread foluso
I've found the problem that caused this.

It was the include zero impressions flag. 

Not setting it gets rid of the bug. 

Why is that?

On Tuesday, August 16, 2016 at 1:40:31 PM UTC+1, 
fol...@brainlabsdigital.com wrote:
>
> Hi,
>
> I am trying to use the Adwords PHP API ReportUtils object. 
>
> Here is the code:
>
> $util = new ReportUtils();
> // Download report.
> $report = $util->DownloadReport($reportDefinition, null, 
> $this->adwordsClient, $options);
>
>
> The same code works perfectly on the CAMPAIGN_PERFORMANCE_REPORT and on 
> any other report. 
>
> However it doesn't work on the SEARCH_QUERY_PERFORMANCE_REPORT
>
> I had it working previously, but now every time I try to run this code I 
> get the following stack trace:
>
> PHP Notice:  Undefined index: type in 
> /home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php
>  
> on line 136
> PHP Fatal error:  Uncaught exception 'ReflectionException' with message 
> 'Property  does not exist' in 
> /home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php:138
> Stack trace:
> #0 
> /home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php(138):
>  
> ReflectionClass->getProperty('')
> #1 
> /home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php(92):
>  
> XmlDeserializer->ConvertElementToObject(Object(DOMElement), 'ApiError')
> #2 
> /home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php(63):
>  
> XmlDeserializer->ConvertElementToObject(Object(DOMElement))
> #3 
> /home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/v201605/ReportUtilsDelegate.php(194):
>  
> XmlDeserializer-> in 
> /home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php
>  
> on line 138
>
> Does anyone know what I could be doing wrong please?
>
> Like I said before, the only thing I change that produces the error, is 
> the name of the report. 
>
> Assume I am passing in no predicates, and only the 'AdGroupId' field into 
> the selector. 
>
> 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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d96088cb-b0c1-4d10-bf5b-24e4f566c20e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


'ReflectionException' while using ReportUtils in Adwords API v201605

2016-08-16 Thread foluso
Hi,

I am trying to use the Adwords PHP API ReportUtils object. 

Here is the code:

$util = new ReportUtils();
// Download report.
$report = $util->DownloadReport($reportDefinition, null, 
$this->adwordsClient, $options);


The same code works perfectly on the CAMPAIGN_PERFORMANCE_REPORT and on any 
other report. 

However it doesn't work on the SEARCH_QUERY_PERFORMANCE_REPORT

I had it working previously, but now every time I try to run this code I 
get the following stack trace:

PHP Notice:  Undefined index: type in 
/home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php
 
on line 136
PHP Fatal error:  Uncaught exception 'ReflectionException' with message 
'Property  does not exist' in 
/home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php:138
Stack trace:
#0 
/home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php(138):
 
ReflectionClass->getProperty('')
#1 
/home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php(92):
 
XmlDeserializer->ConvertElementToObject(Object(DOMElement), 'ApiError')
#2 
/home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php(63):
 
XmlDeserializer->ConvertElementToObject(Object(DOMElement))
#3 
/home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/v201605/ReportUtilsDelegate.php(194):
 
XmlDeserializer-> in 
/home/foluso/Documents/webProgramming/projects/sqrt/vendor/googleads/googleads-php-lib/src/Google/Api/Ads/AdWords/Util/XmlDeserializer.php
 
on line 138

Does anyone know what I could be doing wrong please?

Like I said before, the only thing I change that produces the error, is the 
name of the report. 

Assume I am passing in no predicates, and only the 'AdGroupId' field into 
the selector. 

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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d693ae9e-51b7-4ecb-9fd8-4bbcf750af23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I add gender bid modifiers

2016-06-02 Thread foluso
Hi Peter,

Thanks for your reply. 

In that case I will have to do it from the adwords interface manually. 
However, there is still a problem with setting them from the interface... 
The situation is as follows.

Trying to set the Gender Bid Modifier to 0% for all rows (online interface) 
in an account (all adgroups), the operation fails with message "Your change 
was not applicable to any of the selected rows".

This error only occurs while operating on all adgroups ().

When performing the exact same operation on 500 rows (max page size), it 
works completely fine. 

Is there a potential fix to this problem?

Thanks!
Foluso

On Wednesday, June 1, 2016 at 10:05:33 PM UTC+1, Peter Oliquino wrote:
>
> Hi Foluso,
>
> Unfortunately, bid modifiers are only available for Platform criterion, so 
> you will not be able to add bid modifiers for Gender. You can refer to this 
> guide 
> <https://developers.google.com/adwords/api/docs/guides/adgroup-bid-modifiers> 
> for 
> more information. 
>
> Thanks,
> Peter
> 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 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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/2c1a0a4c-09a2-4659-944d-07ac0a39aa78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I add gender bid modifiers

2016-06-01 Thread foluso
Hi,

The AdGroupBidModifierService (v201605) explicitly states "Currently 
supports platform (mobile) bid multiplier overrides only 
<https://developers.google.com/adwords/api/docs/reference/v201605/AdGroupBidModifierService>
"

I am trying to set all the PreferredContent (GENDER) bids to zero for all 
adgroups in an entire account, via api. 

I have tried using the service above, but as expected, it failed with an 
error OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE . Trigger: 'SEARCH'.

Is there a way to automatically set the bid multiplier for gender? 

I understand this feature is quite new, maybe there is something in the 
docs that I missed?

Foluso

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/2ebdef4b-3208-4a0a-bad1-53e9ccc01b5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is there a Doubleclick Bidmanager API forum please?

2016-05-16 Thread foluso
I can't seem to find one on google groups

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/807e5f76-f787-4cbd-973d-ac3f192c9ac2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: BatchJobService.FILE_FORMAT_ERROR on CampaignOperations

2016-04-28 Thread foluso
Hi Yin, 

I have sent you a private response but I don't know how to view and confirm 
it's sent. 

Please let me know if you received it. 

Thanks

Bo

On Wednesday, April 27, 2016 at 5:26:27 PM UTC+1, 
fol...@brainlabsdigital.com wrote:
>
> Hi, 
>
> I have a problem using the BatchJobService. 
>
> My environment is Python3.5 and I am using the latest version of 
> googleads, and accessing the API version v201603
>
> I am trying to perform a series of campaign operations using the batch job 
> service, here is my code. 
>
>
> def upload_batch_operations(self, batch_job, operations, func=None):
>
>
> batch_job_helper = self.client.GetBatchJobHelper()
>
>
> # Retrieve the URL used to upload the BatchJob operations.
> upload_url = batch_job['uploadUrl']['url']
> batch_job_id = batch_job['id']
>
>
> incremental_uploader = batch_job_helper.GetIncrementalUploadHelper
> (upload_url)
> # batch_job_helper.UploadOperations(upload_url, operations)
> incremental_uploader.UploadOperations([operations], is_last=True)
>
>
> I have tried using both the UploadOperations functions from the 
> incremental and normal function (commented out above)
>
> For creation of the operations -->
>
>
> def campaign_status_operations(self, campaign_ids, status):
>
> # Construct operations and update campaign.
> operations = [{
> 'xsi_type': 'CampaignOperation',
> 'operator': 'SET',
> 'operand': {
> 'id': campaign_id,
> 'status': status,
> }
> } for campaign_id in campaign_ids if campaign_ids]
>
> return operations
>
>
> I have executed this code successfully several times in the past using 
> version v201506, up until this month.
>
> Was a lot changed in the new version that could cause this file format 
> error?
>
> I am not even uploading a file.
>
> Thanks,
>
> Bo
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9c73d2ca-f7f4-49f3-826f-b5d143b250a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


BatchJobService.FILE_FORMAT_ERROR on CampaignOperations

2016-04-27 Thread foluso
Hi, 

I have a problem using the BatchJobService. 

My environment is Python3.5 and I am using the latest version of 
googleads, and accessing the API version v201603

I am trying to perform a series of campaign operations using the batch job 
service, here is my code. 


def upload_batch_operations(self, batch_job, operations, func=None):


batch_job_helper = self.client.GetBatchJobHelper()


# Retrieve the URL used to upload the BatchJob operations.
upload_url = batch_job['uploadUrl']['url']
batch_job_id = batch_job['id']


incremental_uploader = batch_job_helper.GetIncrementalUploadHelper(
upload_url)
# batch_job_helper.UploadOperations(upload_url, operations)
incremental_uploader.UploadOperations([operations], is_last=True)


I have tried using both the UploadOperations functions from the incremental 
and normal function (commented out above)

For creation of the operations -->


def campaign_status_operations(self, campaign_ids, status):

# Construct operations and update campaign.
operations = [{
'xsi_type': 'CampaignOperation',
'operator': 'SET',
'operand': {
'id': campaign_id,
'status': status,
}
} for campaign_id in campaign_ids if campaign_ids]

return operations


I have executed this code successfully several times in the past using 
version v201506, up until this month.

Was a lot changed in the new version that could cause this file format 
error?

I am not even uploading a file.

Thanks,

Bo

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/71f13460-e70b-4d2a-9003-e57b29f83e25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


BatchJobService Attribute error in Python 3 but not Python 2

2016-03-19 Thread foluso
When I try to run a particular script in python3.5 I get the error:


AttributeError: 'bytes' object has no attribute 'encode'. Is this common or 
am I doing something wrong. 

Python 2.7 works perfect. 

The particular line of code that causes this is 
batch_job_helper.UploadOperations(upload_url, operations).

Assume the operations and upload_url are perfectly fine, as I can run the 
same line in python2 and it works fine.

 stack trace is below:

  File 
"/Users/folusoogunlana/Documents/webProgramming/brainlabs/ts/techstack/brsb/brsb_helper.py",
 
line 661, in upload_batch_operations

batch_job_helper.UploadOperations(upload_url, operations)

  File 
"/Users/folusoogunlana/.virtualenvs/blabs/lib/python3.5/site-packages/googleads/adwords.py",
 
line 845, in UploadOperations

uploader.UploadOperations(operations, is_last=True)

  File 
"/Users/folusoogunlana/.virtualenvs/blabs/lib/python3.5/site-packages/googleads/adwords.py",
 
line 990, in UploadOperations

current_content_length=self._current_content_length, is_last=is_last)

  File 
"/Users/folusoogunlana/.virtualenvs/blabs/lib/python3.5/site-packages/googleads/adwords.py",
 
line 591, in BuildUploadRequest

has_suffix=is_last)

  File 
"/Users/folusoogunlana/.virtualenvs/blabs/lib/python3.5/site-packages/googleads/adwords.py",
 
line 628, in _BuildUploadRequestBody

for operations_list in operations])

  File 
"/Users/folusoogunlana/.virtualenvs/blabs/lib/python3.5/site-packages/googleads/adwords.py",
 
line 628, in 

for operations_list in operations])

  File 
"/Users/folusoogunlana/.virtualenvs/blabs/lib/python3.5/site-packages/googleads/adwords.py",
 
line 714, in _GenerateOperationsXML

return self._ExtractOperations(self._GenerateRawRequestXML(operations))

  File 
"/Users/folusoogunlana/.virtualenvs/blabs/lib/python3.5/site-packages/googleads/adwords.py",
 
line 653, in _ExtractOperations

mutate = self._GetRawOperationsFromXML(full_soap_xml)

  File 
"/Users/folusoogunlana/.virtualenvs/blabs/lib/python3.5/site-packages/googleads/adwords.py",
 
line 768, in _GetRawOperationsFromXML

root = ElementTree.fromstring(raw_request_xml.encode('utf-8'))
AttributeError: 'bytes' object has no attribute 'encode' 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/9ea341e2-7e4d-466b-b206-b5a2ad17d957%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Batch Job Service v201601. How long should a script wait before giving up?

2016-02-25 Thread foluso
Hi Thanet, 

Thanks for your prompt response! 

I have been using the BatchJobService all week and haven't re-encountered 
the same problems. 

But I am keeping all the logs, so I will respond if it occurs again. 

Thanks!

Foluso

On Thursday, February 25, 2016 at 5:54:42 AM UTC, Thanet Knack 
Praneenararat (AdWords API Team) wrote:
>
> Hello foluso,
>
> 1 - Is it possible for the job to take a very long time occaisionally? And 
>> rarely fail for reasons unknown, and maybe not change the status after 
>> failing or completing?
>
> We have been aware of this issue and just improved the overall performance 
> and reliability recently.
> Could you please have a try again and let us know if you're still faced 
> with this issue?
> If you happen to be faced with this issue, please send your SOAP logs to 
> us by *Reply privately to author*.
>
> 2 - Is there a maximum waiting time (maybe it's in the docs and I missed 
>> it) at which I should stop polling the status and assume the job has 
>> failed, or double check with the account on the Adwords website.
>
> There is no maximum waiting time suggested currently. 
> But if you try as done in our code example, but still don't get the job in 
> a DONE or CANCELLED state, please inform us as there may be something wrong 
> occurred.
>
> Cheers,
> Thanet, AdWords API Team
>
> On Wednesday, February 24, 2016 at 10:30:06 PM UTC+9, 
> fol...@brainlabsdigital.com  wrote:
>>
>>
>> This is a question about the new BatchJobService 
>> <https://developers.google.com/adwords/api/docs/reference/v201601/BatchJobService>,
>>  
>> replacement to MutateJobService 
>> <https://developers.google.com/adwords/api/docs/reference/v201601/MutateJobService>
>> .
>>
>> I am using the v201601 Python library which is very well explained and 
>> documented. 
>>
>> Short question:
>>
>> - Is it possible for the BatchJobService to be "DONE", or "CANCELLED". 
>> Without a corresponding change in the batch job object which was selected 
>> by Id. 
>>
>> Long explanation:
>>
>> I used the BatchJobService to update the status 2701 campaigns all at 
>> once.
>> I was able to poll the status using the selector and predicates EQUALS 
>>  with an exponential drop off as recommended in the example
>> This worked reliably most of the time, and completed in 30 - 40s on 
>> average.
>> Occasionally, the exact same request would complete in 3 minutes with a 
>> status of "AWAITING _FILE" or "ACTIVE"
>> I believe the operations usually completed eventually, but once in a 
>> while they did not. 
>>
>> This problem is difficult to replicate as the service usually works 
>> perfectly, but I will try to log all the interations in the future so I can 
>> provide more details. 
>>
>>
>> Long Question:
>>
>> Assuming:
>>
>> - I have polled the correct batch job Id
>> - I have indeed uploaded operations to the batch job
>> - I polled the batch job status exactly as recommended in the 
>> documentation
>>
>> 1 - Is it possible for the job to take a very long time occaisionally? 
>> And rarely fail for reasons unknown, and maybe not change the status after 
>> failing or completing?
>>
>> 2 - Is there a maximum waiting time (maybe it's in the docs and I missed 
>> it) at which I should stop polling the status and assume the job has 
>> failed, or double check with the account on the Adwords website.
>>
>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/23980394-96f4-4701-bed8-766542e70c5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Batch Job Service v201601. How long should a script wait before giving up?

2016-02-24 Thread foluso

This is a question about the new BatchJobService 
,
 
replacement to MutateJobService 

.

I am using the v201601 Python library which is very well explained and 
documented. 

Short question:

- Is it possible for the BatchJobService to be "DONE", or "CANCELLED". 
Without a corresponding change in the batch job object which was selected 
by Id. 

Long explanation:

I used the BatchJobService to update the status 2701 campaigns all at once.
I was able to poll the status using the selector and predicates EQUALS 
 with an exponential drop off as recommended in the example
This worked reliably most of the time, and completed in 30 - 40s on average.
Occasionally, the exact same request would complete in 3 minutes with a 
status of "AWAITING _FILE" or "ACTIVE"
I believe the operations usually completed eventually, but once in a while 
they did not. 

This problem is difficult to replicate as the service usually works 
perfectly, but I will try to log all the interations in the future so I can 
provide more details. 


Long Question:

Assuming:

- I have polled the correct batch job Id
- I have indeed uploaded operations to the batch job
- I polled the batch job status exactly as recommended in the documentation

1 - Is it possible for the job to take a very long time occaisionally? And 
rarely fail for reasons unknown, and maybe not change the status after 
failing or completing?

2 - Is there a maximum waiting time (maybe it's in the docs and I missed 
it) at which I should stop polling the status and assume the job has 
failed, or double check with the account on the Adwords website.


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ae9272ab-3aad-4045-ae29-ef293b12774f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Miminal Python Example

2015-10-14 Thread Foluso Ogunlana
Hi Everyone, 

I've had this exact same problem and I solved it by including the path to 
googleads.yaml as an argument to LoadFromStorage.

adwords.AdWordsClient.LoadFromStorage('PATH_TO_GOOGLEADS.YAML')

Thanks

On Tuesday, 7 July 2015 14:26:46 UTC+1, Aydoğan Karagöz wrote:
>
> Hello Everyone!
>
> I am very new with AdWords API and trying to execute very basic example 
> 
>  
> from the library.
>
> I just filled   *developer_token*, *user_agent*, *client_id*, 
> *client_secret* and *refresh_token* fields in googleads.yaml file and put 
> it in my home directory.
>
> When I run that example script, I get the following error:
>
> Traceback (most recent call last):
>
>   File "get_campaigns.py", line 81, in 
>
> main(adwords_client)
>
>   File "get_campaigns.py", line 58, in main
>
> print campaign_service.get(selector)
>
>   File "build/bdist.macosx-10.10-intel/egg/googleads/common.py", line 294, 
> in MakeSoapRequest
>
>   File "build/bdist.macosx-10.10-intel/egg/googleads/adwords.py", line 
> 335, in SetHeaders
>
>   File "build/bdist.macosx-10.10-intel/egg/googleads/oauth2.py", line 150, 
> in CreateHttpHeader
>
>   File "build/bdist.macosx-10.10-intel/egg/googleads/oauth2.py", line 166, 
> in Refresh
>
>   File 
> "/Library/Python/2.7/site-packages/oauth2client-1.4.11-py2.7.egg/oauth2client/client.py",
>  
> line 598, in refresh
>
>   File 
> "/Library/Python/2.7/site-packages/oauth2client-1.4.11-py2.7.egg/oauth2client/client.py",
>  
> line 769, in _refresh
>
>   File 
> "/Library/Python/2.7/site-packages/oauth2client-1.4.11-py2.7.egg/oauth2client/client.py",
>  
> line 834, in _do_refresh_request
>
> oauth2client.client.AccessTokenRefreshError: invalid_grant
>
>
> Any suggestion of your to fix that error is welcome.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/c58fd23c-a79b-4059-9bda-a2df0b6f43cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.