admin管理员组文章数量:1122846
I am trying to get the search terms,but it is returning 32k records at once. I want to limit the result and implement pagination so that it returns 100 records at a time. I can't find anything in the docs for the npm package.
I am trying to get the search terms,but it is returning 32k records at once. I want to limit the result and implement pagination so that it returns 100 records at a time. I can't find anything in the docs for the npm package.
Share Improve this question asked Nov 22, 2024 at 7:35 Bipasha RoyBipasha Roy 11 Answer
Reset to default 0You can set limit in query :
const query = `SELECT campaign.id, campaign.name,metrics.clicks FROM campaign LIMIT 100`;
const response = await customer.query({
query: query,
page_size: 100,
page_token: pageToken,
});
console.log('Results:', response.results);
pageToken = response.next_page_token;
You can use do while loop for fetching all data until pageToken
has value.
本文标签: nodejsHow can I implement pagination using the googleadsapi Node js packageStack Overflow
版权声明:本文标题:node.js - How can I implement pagination using the google-ads-api Node js package? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736305434a1932590.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论