我需要使用Adwords API从Adwords检索数据。
我成功地检索了帐户、广告系列、广告组、广告和关键字,并包含所有必要的属性等。
但是在检索站点链接时出现问题。
我尝试为活动广告系列获取100个站点链接(其中6个被选中)。
根据此文档,我使用CampaignAdExtensionService并选择CampaignAdExtensionService字段。 这是我的ruby代码(假设campaign_id为12345678):
campaign_srv = @api.service(:CampaignAdExtensionService, get_api_version())
campaign_id = 12345678 # for example
selector = {
:fields => ['CampaignId', 'DestinationUrl', 'DisplayText'],
:predicates => {:field => "CampaignId", :operator => "IN", :values => Array(campaign_id)},
:paging => {:start_index => 0, :number_results => 5000}
}
page = campaign_srv.get(selector)
运行此代码后,我得到的哈希对象不含任何站点链接: page.to_json = "{"total_num_entries":1,"page_type":"CampaignAdExtensionPage","entries":[{"campaign_id":12345678,"ad_extension":{"id":76543210,"ad_extension_type":"LocationSyncExtension","email":"mail*@domain*.com","icon_media_id":1000,"should_sync_url":false,"xsi_type":"LocationSyncExtension"},"stats":{"network":"ALL","stats_type":"CampaignAdExtensionStats"}}]}"
如何检索广告系列中的所有站点链接?