I need to get data from Adwords using the Adword API.
I managed to get accounts, campaigns, ad groups, ads and keywords with all the necessary attributes, etc.
I have a problem finding links to a site.
I am trying to do this for a campaign that is an active campaign with 100 sitelinks (6 of them selected).
Following this documentation, I use CampaignAdExtensionService and select the CampaignAdExtensionService field. Here is my ruby code (say campaign_id 12345678):
campaign_srv = @api.service(:CampaignAdExtensionService, get_api_version())
campaign_id = 12345678
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)
Running this code I get a hash object that does not contain a link:
page.to_json = "{" total_num_entries ": 1," page_type ":" CampaignAdExtensionPage "," entries ": [{" campaign_id ": 12345678," ad_extension ": {" id ": 76543210," ad_extension_type ":" LocationSyncExtension "," ":" * @domain *.com "," icon_media_id ": 1000," should_sync_url "" xsi_type ":" LocationSyncExtension "}," ": {" ":" "," stats_type ":" CampaignAdExtensionStats "}}]}"
?