Hi,

I finally find how to exclude negative keywords from our retrieved reports.
You can see the code below, retrieving anf filtering the "IsNegative" field.

Problem seems to be solved,

   public Long getReportDefinitionIdForUser(AdWordsUser user, String startDate, 
String endDate)

         throws AdWordsClientException {

      try {

         ReportDefinitionServiceInterface reportDefinitionService = 
getReportDefinitionService(user);

         Selector selector = new Selector();

         selector.setFields(new String[] { "ExternalCustomerId", 
"CampaignName", "AdGroupName", "KeywordText",

               "KeywordMatchType", "Status", "DestinationUrl", "AdGroupStatus", 
"CampaignStatus", "Impressions",

               "AdGroupId", "CampaignId", "AccountDescriptiveName", "Id", 
"CustomerDescriptiveName",

               "PrimaryCompanyName", "PrimaryUserLogin", "IsNegative" });

         selector.setDateRange(new DateRange(startDate, endDate));

         Predicate negativePredicate = new Predicate("IsNegative", 
PredicateOperator.EQUALS, new String[] { "false" });

         selector.setPredicates(new Predicate[] { negativePredicate });         

         ReportDefinition[] filteredReportDefinitions = 
createReportDefinitions(reportDefinitionService, selector);

         return getFirstReportDefinitionId(filteredReportDefinitions);

      } catch (ServiceException e) {

         throw new AdWordsClientException("Problem while using adword api :", 
e);

      }

   }

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

Reply via email to