Re: Page token has expired

2022-06-08 Thread Alin Alex
We fall back to pagination because on the search stream we encountered 
another error with the message "connection reset by peer", and now we end 
up in this token invalidation.

On Tuesday, June 7, 2022 at 9:41:23 PM UTC+3 adsapi wrote:

> Hi Alin,
>
> Is it possible for you to use the SearchStream method instead of Search? 
> If you do not require paginated results, the SearchStream method will work 
> better as the entire result is cached in a data buffer. Please see this 
> page 
>  
> on streaming for more details on Search/SearchStream. In general, we 
> recommend using SearchStream whenever possible. 
>
> Additionally, you may try breaking your report up into smaller date 
> ranges, or use fewer fields in your report, if possible.
>
> Regards,
> Matt
> Google Ads API Team
>
> [image: Google Logo] 
> Matt 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2bd4dK: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 
"Google Ads API and AdWords 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/8e8cd512-d1be-4cdf-add2-5ea06a430e34n%40googlegroups.com.


Re: Page token has expired

2022-06-07 Thread Alin Alex
Hello, thank you for the response but

As we can see in the logs that I've provided, those logs are coming from 
the client library itself and are not altered by us by any means, we have a 
page size of 1000 and the time between each request is likely 3-6 minutes. 
I do not think is because of the processing time, because every run is 
failing after 4 hours.
You do not think is another timeout issue with another API component?

On Tuesday, June 7, 2022 at 5:07:05 PM UTC+3 adsapi wrote:

> Hi Alin,
>
> Thank you for reaching out to us.
>
> Please note that Page token has expired 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).
>
> In addition, those page tokens have a life span of two hours. If you try 
> to grab the next token after life span, then you might get that error. 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.
>
> Best regards,
> [image: Google Logo] 
> Heidi 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2bd4dK: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 
"Google Ads API and AdWords 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/ce96aa18--47bc-834c-4d6c862df46en%40googlegroups.com.


Page token has expired

2022-06-07 Thread Alin Alex
Currently we are making some search calls to googleads using search method 
with python client library.
After 4 hours we get message: "Page token has expired."

We have the following questions:
Because from the logs we cannot see and the implementation of pagination is 
implemented directly into the python library, the error is being thrown on 
the iteration part or when we try to grab the next token?


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"Google Ads API and AdWords 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/9463d014-9154-43a4-a783-9428a2facbb6n%40googlegroups.com.


- INFO: Request made: ClientCustomerId: 606852287
Description: Binary data


Re: Budget field is not found on the new google ads mapping

2022-02-28 Thread Alin Alex
Thank you, it worked!

On Wednesday, February 23, 2022 at 7:31:45 PM UTC+2 adsapi wrote:

> Hi,
>
> Thank you for reaching out to the Google Ads API support team.
>
> With regards to your concern, you can use query migration tools 
> 
>  
> to migrating query from AWQL to GAQL.You can use campaign.budget 
> 
>  
> field to get the budget via campaign report in the Google Ads API. Let me 
> know if you have any question.
>
> Thanks,
> [image: Google Logo] 
> Nirmita 
> Google Ads API Team 
>   
>  
>
> ref:_00D1U1174p._5004Q2WyIAH: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 
"Google Ads API and AdWords 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/7dabec98-9a8b-4d89-bcfc-ebc827a12f61n%40googlegroups.com.


Budget field is not found on the new google ads mapping

2022-02-23 Thread Alin Alex
I am trying to migrate a script from adwords to ads and the following field 
is not listed anywhere into the official mapping pages:

Report query in adwords:

report = {
'reportName': 'CAMPAIGN_PERFORMANCE_REPORT',
'dateRangeType': 'LAST_30_DAYS',
'reportType': 'CAMPAIGN_PERFORMANCE_REPORT',
'downloadFormat': 'XML',
'selector': {
'fields': ['Date', 'Device', 'AccountDescriptiveName', 'CampaignName', 
'CampaignId',
  'CampaignStatus', 'Labels', 'Amount', 'AveragePosition',
  'SearchImpressionShare', 'Impressions', 'Clicks', 'Cost'],
'predicates': {
   'field': 'CampaignStatus',
   'operator': 'IN',
   'values': ['ENABLED', 'PAUSED']}}}

And after that I am parsing the xml and I use the 'budget' key that in ads 
is not to be found:

elem.get('budget')
ls -la
Can you direct me to the exact match from googleads? 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"Google Ads API and AdWords 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/984de918-1313-45cf-8a2c-92ce58a528aan%40googlegroups.com.


Google Ads api return only some portion of rows compared to adwords api

2022-02-23 Thread Alin Alex
I am currently migrating from adwords to googleads and i kinda matched the 
following query:
adwords:
 

oauth2_client = oauth2.GoogleRefreshTokenClient(client_id, 
client_secret, refresh_token)
adwords_client = adwords.AdWordsClient(developer_token, 
oauth2_client, client_customer_id)

adwords_client.SetClientCustomerId(acct)
report_downloader = 
adwords_client.GetReportDownloader(version=gk.adwords_version)

 

report = {
'reportName': 'CAMPAIGN_PERFORMANCE_REPORT',
'dateRangeType': 'LAST_30_DAYS',
'reportType': 'CAMPAIGN_PERFORMANCE_REPORT',
'downloadFormat': 'XML',
'selector': {
'fields': ['Date', 'Device', 'AccountDescriptiveName', 
'CampaignName', 'CampaignId',
   'CampaignStatus', 'Labels', 'Amount', 
'AveragePosition',
   'SearchImpressionShare', 'Impressions', 
'Clicks', 'Cost'],
'predicates': {
'field': 'CampaignStatus',
'operator': 'IN',
'values': ['ENABLED', 'PAUSED']
}
}
}

stream_data = report_downloader.DownloadReportAsStream(
report, skip_report_header=True, skip_column_header=True,
skip_report_summary=True, include_zero_impressions=False)

This has been migrated to adswords:

credentials = {
"use_proto_plus": True,
"developer_token": gk.ads_dev_token,
"refresh_token": gk.adwords_refresh_token,
"client_id": gk.adwords_client_id,
"login_customer_id": gk.ads_login_customer_id,
"client_secret": gk.adwords_client_secret
}

  

googleads_client = GoogleAdsClient.load_from_dict(credentials)
ga_service = googleads_client.get_service("GoogleAdsService")

query_ads = '''
SELECT segments.date, segments.device, customer.descriptive_name, 
campaign.name, campaign.id,
campaign.status, campaign_budget.amount_micros, 
metrics.search_impression_share,  metrics.impressions, 
metrics.clicks, metrics.cost_micros 
FROM campaign
WHERE segments.date DURING LAST_30_DAYS
'''
response = ga_service.search_stream(customer_id=str(acct), 
query=query_ads)


Depending on the customer_id, google ads reporting kinda 10%- 20% of what 
googleads return.

Any advice on this, i've read all the articles regarding filtering and i 
think everything is good on this side.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"Google Ads API and AdWords 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/33ef6f14-72db-4121-97d9-90a361769ee9n%40googlegroups.com.