TargetingIdeaSelector to filter results properly
HI Guys, We use the targetingideaservice to get alternative keywords but we are getting 3 results for every seed keyword which I understand is for, broad,exact and phrase. But it is all exactly the same. cheap airline tickets/EXACT cheap airline tickets/BROAD cheap airline tickets/PHRASE airline tickets/BROAD airline tickets/EXACT airline tickets/PHRASE In the Adwords API Blog I found this code: // Using the same keyword from above, filter by removing the original // keyword, by keeping the same match type, and by only choosing // "long-tail" keywords. new ExcludedKeywordSearchParameter(null, new Keyword[] {keyword}), new KeywordMatchTypeSearchParameter(null, new KeywordMatchType[] {keyword.getMatchType()}), new CompetitionSearchParameter(null, new CompetitionSearchParameterLevel[] { CompetitionSearchParameterLevel.LOW}), The results are now more interesting: legion air tickets/BROAD air tram tickets/BROAD block air tickets/BROAD sheap air tickets/BROAD cheap airfare tracker/BROAD cheap airfare forum/BROAD I want to be able to get the keywords in the second format, but the code in the blog is not working it is seems to be of an older version of the library. Can anyone please help me to remove the duplicate entries from the results? Here is my current code if someone needs to see it. Thanks try { // Get the TargetingIdeaService. TargetingIdeaService targetingIdeaService = (TargetingIdeaService)user.GetService(AdWordsService.v200909.TargetingIdeaService); string keywordText = strSeedKeyword; Keyword keyword = new Keyword(); keyword.text = keywordText; keyword.matchTypeSpecified = true; keyword.matchType = thisKeyWordType; RelatedToKeywordSearchParameter searchParameter = new RelatedToKeywordSearchParameter(); searchParameter.keywords = new Keyword[] { keyword }; TargetingIdeaSelector selector = new TargetingIdeaSelector(); selector.searchParameters = new SearchParameter[] { searchParameter }; selector.ideaTypeSpecified = true; selector.ideaType = IdeaType.KEYWORD; selector.requestTypeSpecified = true; selector.requestType = RequestType.IDEAS; Paging paging = new Paging(); paging.startIndex = 0; paging.startIndexSpecified = true; paging.numberResults = seedResults; paging.numberResultsSpecified = true; selector.paging = paging; try { TargetingIdeaPage page = targetingIdeaService.get(selector); if (page != null && page.entries != null) { foreach (TargetingIdea idea in page.entries) { foreach (Type_AttributeMapEntry entry in idea.data) { if (entry.key == AttributeType.KEYWORD) { KeywordAttribute kwdAttribute = entry.value as KeywordAttribute; seedVariations.Add(kwdAttribute.value.text); } } } } } catch (Exception ex) { logAdwordsMessageToFile("GetKeywordVariations, Keyword=" + strSeedKeyword + ex.Message); } } -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords 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
Re: estimateKeywordList returns 0 for everything
Hey Guys! Just to let you know, I found the problem. Turns out I had the MaxCPC too low so no keywords were returned. On May 30, 1:50 am, Riaan van der Linde wrote: > Hi Eric, > Thanks for the response. > > Please have a look at this: > This is the constructor for my adwords class: > > Dictionary headers = new Dictionary string>(); > > headers.Add("email", email); > headers.Add("password", password); > headers.Add("useragent", useragent); > headers.Add("developerToken", developerToken); > headers.Add("applicationToken", applicationToken); > headers.Add("clientEmail", clientEmail); > > // Create a custom AdWordsUser. > user = new AdWordsUser(headers); > > // Remove this line if you want to run this sample against > production account. > //user.UseSandbox(); > > All I did when we got the developer token approved is update the > variables with the real email,pass and dev token. I then just added my > personal adwords account as a client (because all we want to do is get > traffic estimates and alternative keywords) and then I commented this > line: > // Remove this line if you want to run this sample against > production account. > //user.UseSandbox(); > > Is there something else that I should have done? > About the keywords, I have been trying various keywords and none of > them returned anything. Keywords that included "making money online", > "sleeping bags", "headlines" > > Please advise. > Thank you very much. > Riaan > > On May 28, 6:44 pm, AdWords API Advisor > wrote: > > > Hi Riaan, > > > Please ensure that you are making your request against the production > > API servers and not the sandbox. Also, what keywords are you using? > > Obscure keywords may not have enough data available to generate a > > traffic estimate. > > > Best, > > - Eric Koleda, AdWords API Team > > > On May 28, 7:38 am, Riaan van der Linde wrote: > > > > Hi Guys, > > > Can anyone please point out what I am doing wrong here. > > > Here is my code. > > > Our developer token has been approved and we did complete the billing > > > section of adwords so there are no holds on the account. > > > > try > > > { > > > // Get the service. > > > TrafficEstimatorService service = > > > > (TrafficEstimatorService)user.GetService(AdWordsService.v13.TrafficEstimato > > > rService); > > > > // Set the attributes of the keywords to be estimated. > > > KeywordRequest myKeyword = new KeywordRequest(); > > > myKeyword.text = strKeyword; > > > myKeyword.maxCpc = 5; > > > myKeyword.maxCpcSpecified = true; > > > myKeyword.type = thisKeywordType; > > > myKeyword.typeSpecified = true; > > > > // To estimate more keywords, create more KeywordRequest > > > objects > > > // and add them to the list of keyword to estimate. > > > KeywordRequest[] keyReqs = new KeywordRequest[] > > > { myKeyword }; > > > > // Estimate traffic for given keywords. > > > KeywordEstimate[] estimates = > > > service.estimateKeywordList(keyReqs); > > > > if (estimates != null) > > > { > > > for (int i = 0; i < estimates.Length; i++) > > > { > > > KeywordEstimate estimate = estimates[i]; > > > > lowerClicksPerDay = estimate.lowerClicksPerDay; > > > upperClicksPerDay = estimate.upperClicksPerDay; > > > lowerCPC = estimate.lowerCpc; > > > upperCPC = estimate.upperCpc; > > > lowerAVGPos = estimate.lowerAvgPosition; > > > upperAVGPos = estimate.upperAvgPosition; > > > } > > > } > > > else > > > return; > > > } > > > > On May 27, 2:19 pm, Riaan van der Linde wrote: > > > > > Hi, > > > > > We have used your sandbox feature to develop an application and > > > > received some mock data from your sandbox server. > > > > However since we created a new account and got the developer t
Re: estimateKeywordList returns 0 for everything
Hi Eric, Thanks for the response. Please have a look at this: This is the constructor for my adwords class: Dictionary headers = new Dictionary(); headers.Add("email", email); headers.Add("password", password); headers.Add("useragent", useragent); headers.Add("developerToken", developerToken); headers.Add("applicationToken", applicationToken); headers.Add("clientEmail", clientEmail); // Create a custom AdWordsUser. user = new AdWordsUser(headers); // Remove this line if you want to run this sample against production account. //user.UseSandbox(); All I did when we got the developer token approved is update the variables with the real email,pass and dev token. I then just added my personal adwords account as a client (because all we want to do is get traffic estimates and alternative keywords) and then I commented this line: // Remove this line if you want to run this sample against production account. //user.UseSandbox(); Is there something else that I should have done? About the keywords, I have been trying various keywords and none of them returned anything. Keywords that included "making money online", "sleeping bags", "headlines" Please advise. Thank you very much. Riaan On May 28, 6:44 pm, AdWords API Advisor wrote: > Hi Riaan, > > Please ensure that you are making your request against the production > API servers and not the sandbox. Also, what keywords are you using? > Obscure keywords may not have enough data available to generate a > traffic estimate. > > Best, > - Eric Koleda, AdWords API Team > > On May 28, 7:38 am, Riaan van der Linde wrote: > > > Hi Guys, > > Can anyone please point out what I am doing wrong here. > > Here is my code. > > Our developer token has been approved and we did complete the billing > > section of adwords so there are no holds on the account. > > > try > > { > > // Get the service. > > TrafficEstimatorService service = > > > (TrafficEstimatorService)user.GetService(AdWordsService.v13.TrafficEstimato > > rService); > > > // Set the attributes of the keywords to be estimated. > > KeywordRequest myKeyword = new KeywordRequest(); > > myKeyword.text = strKeyword; > > myKeyword.maxCpc = 5; > > myKeyword.maxCpcSpecified = true; > > myKeyword.type = thisKeywordType; > > myKeyword.typeSpecified = true; > > > // To estimate more keywords, create more KeywordRequest > > objects > > // and add them to the list of keyword to estimate. > > KeywordRequest[] keyReqs = new KeywordRequest[] > > { myKeyword }; > > > // Estimate traffic for given keywords. > > KeywordEstimate[] estimates = > > service.estimateKeywordList(keyReqs); > > > if (estimates != null) > > { > > for (int i = 0; i < estimates.Length; i++) > > { > > KeywordEstimate estimate = estimates[i]; > > > lowerClicksPerDay = estimate.lowerClicksPerDay; > > upperClicksPerDay = estimate.upperClicksPerDay; > > lowerCPC = estimate.lowerCpc; > > upperCPC = estimate.upperCpc; > > lowerAVGPos = estimate.lowerAvgPosition; > > upperAVGPos = estimate.upperAvgPosition; > > } > > } > > else > > return; > > } > > > On May 27, 2:19 pm, Riaan van der Linde wrote: > > > > Hi, > > > > We have used your sandbox feature to develop an application and > > > received some mock data from your sandbox server. > > > However since we created a new account and got the developer token > > > approved that same code is not working anymore. I have even used your > > > own code sample to make sure that I am doing everything right. I tried > > > this class (http://code.google.com/p/google-api-adwords-dotnet/source/ > > > browse/trunk/Examples/v13/KeywordEstimateDemo.cs) > > > > The problem is that I get 1 estimate back from the api but all the > > > following values are set to 0: > > > > estimate.lowerClicksPerDay; > > > estimate.upperClicksPerDay; > > > estimate.lowerCpc; > > > estimate.upperCpc; > > > estimate.lowerAvgPosition; > > > esti
Re: estimateKeywordList returns 0 for everything
Hi Guys, Can anyone please point out what I am doing wrong here. Here is my code. Our developer token has been approved and we did complete the billing section of adwords so there are no holds on the account. try { // Get the service. TrafficEstimatorService service = (TrafficEstimatorService)user.GetService(AdWordsService.v13.TrafficEstimatorService); // Set the attributes of the keywords to be estimated. KeywordRequest myKeyword = new KeywordRequest(); myKeyword.text = strKeyword; myKeyword.maxCpc = 5; myKeyword.maxCpcSpecified = true; myKeyword.type = thisKeywordType; myKeyword.typeSpecified = true; // To estimate more keywords, create more KeywordRequest objects // and add them to the list of keyword to estimate. KeywordRequest[] keyReqs = new KeywordRequest[] { myKeyword }; // Estimate traffic for given keywords. KeywordEstimate[] estimates = service.estimateKeywordList(keyReqs); if (estimates != null) { for (int i = 0; i < estimates.Length; i++) { KeywordEstimate estimate = estimates[i]; lowerClicksPerDay = estimate.lowerClicksPerDay; upperClicksPerDay = estimate.upperClicksPerDay; lowerCPC = estimate.lowerCpc; upperCPC = estimate.upperCpc; lowerAVGPos = estimate.lowerAvgPosition; upperAVGPos = estimate.upperAvgPosition; } } else return; } On May 27, 2:19 pm, Riaan van der Linde wrote: > Hi, > > We have used your sandbox feature to develop an application and > received some mock data from your sandbox server. > However since we created a new account and got the developer token > approved that same code is not working anymore. I have even used your > own code sample to make sure that I am doing everything right. I tried > this class (http://code.google.com/p/google-api-adwords-dotnet/source/ > browse/trunk/Examples/v13/KeywordEstimateDemo.cs) > > The problem is that I get 1 estimate back from the api but all the > following values are set to 0: > > estimate.lowerClicksPerDay; > estimate.upperClicksPerDay; > estimate.lowerCpc; > estimate.upperCpc; > estimate.lowerAvgPosition; > estimate.upperAvgPosition; > > id and idField is also set to "-1" > Can you please help > > The developer token is working because we also use the > AdWordsService.v200909.TargetingIdeaService and that seems to be > returning proper keyword variations. -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords 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
estimateKeywordList returns 0 for everything
Hi, We have used your sandbox feature to develop an application and received some mock data from your sandbox server. However since we created a new account and got the developer token approved that same code is not working anymore. I have even used your own code sample to make sure that I am doing everything right. I tried this class (http://code.google.com/p/google-api-adwords-dotnet/source/ browse/trunk/Examples/v13/KeywordEstimateDemo.cs) The problem is that I get 1 estimate back from the api but all the following values are set to 0: estimate.lowerClicksPerDay; estimate.upperClicksPerDay; estimate.lowerCpc; estimate.upperCpc; estimate.lowerAvgPosition; estimate.upperAvgPosition; id and idField is also set to "-1" Can you please help The developer token is working because we also use the AdWordsService.v200909.TargetingIdeaService and that seems to be returning proper keyword variations. -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords 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