首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >谷歌AdWords应用编程接口产品列表广告

谷歌AdWords应用编程接口产品列表广告
EN

Stack Overflow用户
提问于 2016-02-01 16:37:37
回答 1查看 424关注 0票数 0

这就是我的问题:我需要使用AdWordsAPI获取所有ProductAd Ids的列表。我已经尝试过使用AdGroupAdService,但它只给了我一个Product-Listing-Ad ID。当我在UI中时,大约有2000个广告,所以这似乎是错误的方式。我也考虑过使用购物性能报告,但我不能启用includeZeroImpressions,所以CSV-ResultFile中缺少很多产品。

现在我的问题是,如何获得可用产品的所有Product-Listing-Ad ID的列表?编辑:

代码语言:javascript
复制
// Get the AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdService = new AdWordsServices().get(session, AdGroupAdServiceInterface.class);

    int offset = 0;
    boolean morePages = true;

    // Create selector.
    SelectorBuilder builder = new SelectorBuilder();
    Selector selector =
        builder
            .fields(AdGroupAdField.Id, AdGroupAdField.Status)
            .orderAscBy(AdGroupAdField.Id)
            .offset(offset)
            .limit(GoogleConstants.GOOGLE_PAGE_SIZE)
            // .equals(AdGroupAdField.AdGroupId, adGroupId.toString())
            // .in(AdGroupAdField.Status, "ENABLED", "PAUSED", "DISABLED")
            .equals("AdType", "PRODUCT_AD")
            .build();


        while (morePages) {
            // Get all ads.
            AdGroupAdPage page;
            page = adGroupAdService.get(selector);

            displayAds(page);

            offset += GoogleConstants.GOOGLE_PAGE_SIZE;
            selector = builder.increaseOffsetBy(GoogleConstants.GOOGLE_PAGE_SIZE).build();
            morePages = offset < page.getTotalNumEntries();
        }

我想使用这个列表来构建一个以Offer-ID作为维度的AdGroupPartitionTree。

EN

回答 1

Stack Overflow用户

发布于 2017-05-23 04:20:45

尝试使用PRODUCT_PARTITION_REPORT,而不是购物性能报告。并为includeZeroImpressions设置为true。

这里是文档:https://developers.google.com/adwords/api/docs/appendix/reports/product-partition-report

字段'Id‘是你的ProductAd id,你也可以通过这种方式获取OfferId。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35126073

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档