GoogleAPI-Adwords-Bid Landscapes
2016-01-28 16:52
357 查看
Bid Landscapes 类似于 bid
simulators in the AdWords user interface
bid simulator: 模拟出价。要求:
已经建立了广告或criterion
Conversion Tracking must be enabled.
必须用正式账号,不能用测试账号,因为这是基于以前的正式数据。
实现:
1.设置fields, fetch或get数据
DataServiceInterface dataService = adWordsServices.get(session, DataServiceInterface.class); Selector selector = new SelectorBuilder() .fields( "AdGroupId", "CriterionId", "StartDate", "EndDate", "Bid", "LocalClicks", "LocalCost", "LocalImpressions") // Include whichever fields interest you .equals("AdGroupId", adGroupId.toString()) .build(); CriterionBidLandscapePage page = dataService.getCriterionBidLandscape(selector);
2.分页
selector.getPaging().setNumberResults(PAGE_SIZE); // Set to your desired // page size. int landscapePointsInLastResponse = 0; int offset = 0; do { // Offset by the number of landscape points, NOT the number // of entries (bid landscapes) in the last response. offset += landscapePointsInLastResponse; selector.getPaging().setStartIndex(offset); landscapePointsInLastResponse = 0; CriterionBidLandscapePage page = dataService .getCriterionBidLandscape(selector); if (page.getEntries() != null) { for (CriterionBidLandscape bidLandscape : page.getEntries()) { for (BidLandscapeLandscapePoint landscapePoint : bidLandscape .getLandscapePoints()) { // Process results... landscapePointsInLastResponse++; } } } } while (landscapePointsInLastResponse >= PAGE_SIZE);
结果
<landscapePoints> <bid> <ComparableValue.Type>Money</ComparableValue.Type> <microAmount>990000</microAmount> </bid> <clicks>278000</clicks> <cost> <ComparableValue.Type>Money</ComparableValue.Type> <microAmount>14500000000</microAmount> </cost> <impressions>648000</impressions> <promotedImpressions>0</promotedImpressions> </landscapePoints>
相关文章推荐
- GO语言 特性概要
- Django学习笔记(三)
- django学习
- Golang Channel用法简编
- Codeforces 598D Igor In the Museum (DFS)
- Django基础(一)
- Educational Codeforces Round 5 (D. Longest k-Good Segment)
- google map geocoder 地理位置编码的实例
- Dragon of Loowater(贪心)
- GoldenGate配置(二)之双向复制配置
- 集锦——浏览器每次访问自动更新网页,不用手工设置,附Google/firefox/Ie
- Visualizing Concurrency in Go--转
- MonogoDb的角色分类
- Django搭配Celery进行异步/定时任务(一)初步搭建
- GregorianCalendar 当前时间的昨天18点
- 香港谷歌google公司的福利待遇,惊艳到没???
- 设计模式—适配器模式(Go语言描述)
- 统计数据:Google排名高的是什么样的页面?
- Go学习 数组和切片
- Cassandra中Gossip具体实现方式