Greetings Is there any way to fetch adgroups/campaigns sorted by last updated time. Currently I am fetching data using these methods. What changes should I make ? def fetch_adgroups(self, login_id=None, campaign_ids=None): """ Fetches ad groups from Google.
Note: The AdWords API limits the number of results per request: https://developers.google.com/adwords/api/docs/appendix/limits#general To successfully retrieve results, we chunk our requests by campaign ID. Args: campaign_ids: optional, filter by campaigns """ logging.info('Fetching ad groups from Google.') if campaign_ids: logging.info('Filtering on %s campaign IDs.', len(campaign_ids)) query = """ SELECT campaign.id, ad_group.id, ad_group.name, ad_group.status FROM ad_group WHERE ad_group.status = 'ENABLED'""" if campaign_ids: campaign_ids_str = "','".join(map(str, campaign_ids)) query += f" AND campaign.id IN ('{campaign_ids_str}')" adgroups = [] for row in self.__make_search(query, self.adwords_customer_id, True, login_id): adgroups.append(zeep_helpers.serialize_object(row)) logging.info('Fetched %s ad groups from Google.', len(adgroups)) return adgroups def fetch_campaigns(self, login_id=None): """ Fetches campaigns from Google.""" logging.info('Fetching campaigns from Google.') query = """ SELECT campaign.id, campaign.name, campaign.status FROM campaign WHERE campaign.status = 'ENABLED' ORDER BY campaign.id""" campaigns = [] for row in self.__make_search(query, self.adwords_customer_id, True, login_id): campaigns.append(zeep_helpers.serialize_object(row)) logging.info('Fetched %s campaigns from Google.', len(campaigns)) return campaigns -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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/26021ef8-dfef-4e7f-aa69-414c0f01f336n%40googlegroups.com.