Hi Team , 

We are migrating from google adwords to goole ads api . 
I am following below example reference
https://developers.google.com/google-ads/api/docs/keyword-planning/generate-historical-metrics
here we have  alter the method 
*createKeywordPlanAdGroupKeywords *
and passing a list of text to create a list of KeywordPlanAdGroupKeyword


























*public static void createKeywordPlanAdGroupKeywords( GoogleAdsClient 
googleAdsClient, Long customerId, String planAdGroupResource, List<String> 
keyWords) { // Creates the keywords for keyword plan. 
Stream<KeywordPlanAdGroupKeyword> listKeywordPlanAdGroupKeyword = 
keyWords.stream().map(kw-> getSafeKeyWord(kw)).distinct().map(s -> 
getKeywordPlanAdGroupKeyword(planAdGroupResource,s)); // Creates an 
operation for each plan keyword. List<KeywordPlanAdGroupKeywordOperation> 
operations = listKeywordPlanAdGroupKeyword .map(kw -> 
KeywordPlanAdGroupKeywordOperation.newBuilder().setCreate(kw).build()) 
.collect(Collectors.toList()); try (KeywordPlanAdGroupKeywordServiceClient 
client = 
googleAdsClient.getLatestVersion().createKeywordPlanAdGroupKeywordServiceClient())
 
{ // Adds the keywords. MutateKeywordPlanAdGroupKeywordsResponse response = 
client.mutateKeywordPlanAdGroupKeywords(String.valueOf(customerId), 
operations); // Displays the results. System.out.printf("#### Created 
MutateKeywordPlanAdGroupKeywordResult for keyword plan: %s%n", 
response.getResultsList().size()); for 
(MutateKeywordPlanAdGroupKeywordResult result : response.getResultsList()) 
{ // System.out.printf("Created keyword for keyword plan: %s%n", 
result.getResourceName()); } }}*




















*public static Stream<SearhVolume> 
getMsVolumesList(KeywordPlanKeywordHistoricalMetrics 
kphm){Stream<MonthlySearchVolume> msVolume = 
kphm.getKeywordMetrics().getMonthlySearchVolumesList().stream(); 
Stream<SearhVolume> searchvolumeStream= msVolume.map(y -> new 
SearhVolume(kphm.getSearchQuery(), (int)y.getYear(), 
y.getMonth().getNumber()-1,y.getMonthlySearches()) ); return 
searchvolumeStream; } public static List<SearhVolume> 
generateHistoricalMetricsForPlanId(GoogleAdsClient googleAdsClient, Long 
customerId, Long planId) { String planResourceName = 
ResourceNames.keywordPlan(customerId, planId); try 
(KeywordPlanServiceClient client = 
googleAdsClient.getLatestVersion().createKeywordPlanServiceClient()) { 
GenerateHistoricalMetricsResponse response = 
client.generateHistoricalMetrics(planResourceName); 
List<KeywordPlanKeywordHistoricalMetrics> kwPlanKeywordHistoricalMetrics = 
response.getMetricsList(); System.out.printf("####### Recived 
MutateKeywordPlanAdGroupKeywordResult for keyword plan: %s%n", 
kwPlanKeywordHistoricalMetrics.size()); Stream<SearhVolume> 
searchvolumeStream = kwPlanKeywordHistoricalMetrics.stream().flatMap(x -> 
getMsVolumesList(x)); return 
searchvolumeStream.collect(Collectors.toList()); } }*

Issue : 
Here i am not able to get responce for all the keywords 
for example if i am passing 10 keywords then i am getting responce for only 
8 keywods
what could be the reason for that ?? 
also how can i debug this as API is not failing any where 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ae9289ea-061d-4ddb-9a98-bef69e45b184n%40googlegroups.com.
  • Go... anuj sen
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... anuj sen
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
          • ... anuj sen
            • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
              • ... anuj sen
                • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to