public static String getQuery() { String s = "advertising_channel_type,accessible_bidding_strategy,ad_serving_optimization_status,video_brand_safety_suitability,vanity_pharma.vanity_pharma_text,vanity_pharma.vanity_pharma_display_url_mode,url_custom_parameters,tracking_url_template,tracking_setting.tracking_url,targeting_setting.target_restrictions,target_spend.target_spend_micros,target_spend.cpc_bid_ceiling_micros,target_roas.target_roas,target_roas.cpc_bid_floor_micros,target_roas.cpc_bid_ceiling_micros,target_impression_share.location_fraction_micros,target_impression_share.location,target_impression_share.cpc_bid_ceiling_micros,target_cpm,target_cpa.cpc_bid_floor_micros,target_cpa.cpc_bid_ceiling_micros,status,start_date,shopping_setting.sales_country,shopping_setting.merchant_id,shopping_setting.enable_local,shopping_setting.campaign_priority,serving_status,resource_name,selective_optimization.conversion_actions,real_time_bidding_setting.opt_in,percent_cpc.enhanced_cpc_enabled,percent_cpc.cpc_bid_ceiling_micros,payment_mode,optimization_score,advertising_channel_sub_type,app_campaign_setting.app_id,app_campaign_setting.app_store,app_campaign_setting.bidding_strategy_goal_type,base_campaign,bidding_strategy,bidding_strategy_type,campaign_budget,commission.commission_rate_micros,dynamic_search_ads_setting.domain_name,dynamic_search_ads_setting.feeds,dynamic_search_ads_setting.language_code,target_cpa.target_cpa_micros,dynamic_search_ads_setting.use_supplied_urls_only,end_date,excluded_parent_asset_field_types,experiment_type,final_url_suffix,frequency_caps,geo_target_type_setting.negative_geo_target_type,geo_target_type_setting.positive_geo_target_type,hotel_setting.hotel_center_id,id,labels,local_campaign_setting.location_source_type,manual_cpc.enhanced_cpc_enabled,manual_cpm,manual_cpv,maximize_conversion_value.target_roas,maximize_conversions.target_cpa,name,network_settings.target_content_network,network_settings.target_google_search,network_settings.target_partner_search_network,network_settings.target_search_network,optimization_goal_setting.optimization_goal_types";
String[] ar = s.split(","); String reso = "campaign."; String fr = "campaign"; String query = "SELECT "; String last = ar[ar.length-1]; for(String ars : ar) { String sw = ""; if(ars.equals(last)) { sw = reso+ars+" "; }else { sw = reso+ars+", "; } query = query+sw; } query = query+"FROM "+fr; return query; } private void runExample(GoogleAdsClient googleAdsClient, long customerId) { try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) { SearchGoogleAdsStreamRequest request = SearchGoogleAdsStreamRequest.newBuilder() .setCustomerId(Long.toString(customerId)) .setQuery(SplitQuery.getQuery()) .build(); ServerStream<SearchGoogleAdsStreamResponse> stream = googleAdsServiceClient.searchStreamCallable().call(request); for (SearchGoogleAdsStreamResponse response : stream) { for (GoogleAdsRow googleAdsRow : response.getResultsList()) { // System.out.printf( // "Campaign with ID %d and name '%s' was found.%n", // googleAdsRow.getCampaign().getId(), googleAdsRow.getCampaign().getName()); // System.err.println(googleAdsRow.getCampaign().gettaget); } } -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/9236f97b-36ef-47ce-a008-446f046d5b99n%40googlegroups.com.