Re: Token page has expired error

2019-08-22 Thread Google Ads API Forum Advisor Prod
Hi Rosdyana,

Great, I'm happy I could help! Yes it makes sense that those pages could take a 
long time to process.

I was just double-checking the math in my last message and I think my 
recommendation was inaccurate. If you receive a page with 10,000 rows and a 
page token that expires in 2 hours (or 7,200 seconds), then that leaves you 
with 0.72 seconds to process each row.

If you maintain that rate and change your page_size to 5,000 then you'll only 
spend about 1 hour on each page, well below the time limit for a page token. 
You will still receive the same data, it will just be divided into pages of 
5,000 rows instead of 10,000 rows.

Hope that helps!

Best,
Ben, Google Ads API Team
ref:_00D1U1174p._5001UHE49L:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/w7obx0PWN2O800bfyziKhoQPqGbmFCLpIVKQ%40sfdc.net.


Re: Token page has expired error

2019-08-21 Thread Rosdyana Kusuma
Hi Ben,

Thank you for your explanation, it's a crystal clear now, I guess because I 
made a request with a long duration of time ( almost 2 years, example query 
=  select ... from ... where segments.date between '2018-01-01' and 
'2019-08-20' ), and I use maximum page_size value ( 1 ). 

On Thursday, August 22, 2019 at 4:35:21 AM UTC+8, adsapiforumadvisor wrote:
>
> Hi Rosdyana,
>
> That error indicates that the token used to retrieve a page of results 
> from a search request has expired.
>
> Specifically - when you make a search request in Python an iterator is 
> returned that, under the hood, makes multiple requests to the API as you 
> iterate over it. Each request retrieves a "page" of results, the size of 
> which is defined by the page_size parameter seen here 
> 
> .
>
> If you submit a request that generates 10,000 rows and the page_size is 
> set to 1,000 then the iterator will end up making 10 requests, each for 
> 1,000 rows at a time.
>
> The first response for rows 1 - 1,000 will include a page token that gets 
> passed back to the API so it knows to retrieve rows 1,001 - 2,000, (this is 
> all handled implicitly by the iterator).
>
> Those page tokens have a life span of two hours. So this error likely 
> occurred because two hours went by between page requests. For example if 
> you submitted a request for a report with a page_size of 10,000 with a 
> process that spent roughly 84 seconds processing each row the page token 
> could expire by the time the next page was requested. 
>
> Do you see this error often, or did it just appear one time? 
>
> Best,
> Ben Karl, Google Ads API Team
>
> ref:_00D1U1174p._5001UHE49L:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/3d9efa31-f073-4eb2-beef-245c0a4451a9%40googlegroups.com.


RE: Token page has expired error

2019-08-21 Thread Google Ads API Forum Advisor Prod
Hi Rosdyana,

That error indicates that the token used to retrieve a page of results from a 
search request has expired.

Specifically - when you make a search request in Python an iterator is returned 
that, under the hood, makes multiple requests to the API as you iterate over 
it. Each request retrieves a "page" of results, the size of which is defined by 
the page_size parameter seen here.

If you submit a request that generates 10,000 rows and the page_size is set to 
1,000 then the iterator will end up making 10 requests, each for 1,000 rows at 
a time.

The first response for rows 1 - 1,000 will include a page token that gets 
passed back to the API so it knows to retrieve rows 1,001 - 2,000, (this is all 
handled implicitly by the iterator).

Those page tokens have a life span of two hours. So this error likely occurred 
because two hours went by between page requests. For example if you submitted a 
request for a report with a page_size of 10,000 with a process that spent 
roughly 84 seconds processing each row the page token could expire by the time 
the next page was requested.

Do you see this error often, or did it just appear one time?

Best,
Ben Karl, Google Ads API Team
ref:_00D1U1174p._5001UHE49L:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/lgqqL0PWLT6J00TrVm8lpATuWFgpeu4n5Xkg%40sfdc.net.


Token page has expired error

2019-08-20 Thread Rosdyana Kusuma
Hello, I am using google ads api to create a report for multiple customer 
id, recently I found this on my python error logs

Request made: ClientCustomerId: 2715318609, Host: googleads.googleapis.com:443, 
Method: /google.ads.googleads.v2.services.GoogleAdsService/Search, RequestId: 
3fE4mJzCrjc_FwYemLzI6g, IsFault: True, FaultMessage: Page token has expired.

I looking for the error at 
https://developers.google.com/google-ads/api/docs/best-practices/common-errors 
but no luck, 

no common error mentioned about token page, what's it error about and how to 
solve it?

Thank you.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/4552042c-b39e-4988-960a-544e96d9ccf6%40googlegroups.com.