Keywords_Performance_Report - how to download data for deleted keywords?

454 views
Skip to first unread message

Crosby (StoneTempleConsulting)

unread,
Aug 13, 2012, 4:40:23 PM8/13/12
to adwor...@googlegroups.com
I'm trying to get a full snapshot of all structure data, including deleted keywords.
The following report spec appears to fail to return data for deleted keywords in some cases.
Any help modifying my report spec, or explaining the proper use of AdHoc reports for my purpose would be great.

adwords lib: v201109
.NET lib: awapi_dotnet_lib_v13.3.0

FYI: In another report, I do get performance data, including rows for keywords which are currently deleted, but which got traffic during my report range.  That's good.  However, in this report I'm not interested in performance data per se.  I'd like to be able to pull a report the status of everything as of today.

FYI - date range set to "today" elsewhere in the code.
FYI - setting definition.includeZeroImpressions = true;

possible cause: Is this a data freshness issue?

<<Code Snippet follows>>

      ReportDefinition definition = new ReportDefinition();       definition.reportName = "PPCTools_Adwords_AdGroupCriterion";       definition.reportType = ReportDefinitionReportType.KEYWORDS_PERFORMANCE_REPORT;       definition.downloadFormat = DownloadFormat.TSV;       definition.dateRangeType = ReportDefinitionDateRangeType.CUSTOM_DATE;       // http://code.google.com/apis/adwords/docs/appendix/reports.html       Selector selector = new Selector();       selector.fields = new string[] {             "ExternalCustomerId"             ,"CampaignId"             ,"AdGroupId"             ,"Id"             ,"AccountDescriptiveName"             ,"CampaignName"             ,"AdGroupName"             ,"KeywordText"             ,"KeywordMatchType"             ,"IsNegative"             ,"MaxCpc"             ,"CampaignStatus"             ,"AdGroupStatus"             ,"Status"             ,"QualityScore"       };       // Fails to download deleted keywords       Predicate statusPredicate = new Predicate();       statusPredicate.field = "Status";       statusPredicate.@operator = PredicateOperator.IN;       statusPredicate.values = new string[] { "ACTIVE""PAUSED""DELETED" };       // NOPE: Seems to limit us to non-deleted keywords.  We want everything.       //Predicate ImpressionsPredicate = new Predicate();       //ImpressionsPredicate.field = "Impressions";       //ImpressionsPredicate.@operator = PredicateOperator.GREATER_THAN_EQUALS;       //ImpressionsPredicate.values = new string[] { "0" };       // NOPE: Seems to limit to items with traffic on the search network.  We want everything.       //Predicate AdNetworkType1Predicate = new Predicate();       //AdNetworkType1Predicate.field = "AdNetworkType1";       //AdNetworkType1Predicate.@operator = PredicateOperator.IN;       //AdNetworkType1Predicate.values = new string[] { "SEARCH" };       //selector.predicates = new Predicate[] { statusPredicate, ImpressionsPredicate, AdNetworkType1Predicate };       //selector.predicates = new Predicate[] { statusPredicate, ImpressionsPredicate };       selector.predicates = new Predicate[] { statusPredicate };       selector.dateRange = dates;       definition.selector = selector;       definition.includeZeroImpressions = true;       bool inMicros = false;


Crosby (StoneTempleConsulting)

unread,
Aug 13, 2012, 5:17:11 PM8/13/12
to adwor...@googlegroups.com
Possibly Resolved: Include the entire date range in order to get all inactive objects.

Is this really the only way to get everything?
Is there a better way to get status, Bid, and QualityScore for ALL Keywords, as of today?

thanks kindly,
~Crosby

Dorian Kind

unread,
Aug 13, 2012, 9:35:31 PM8/13/12
to adwor...@googlegroups.com
Hi Crosby,

my guess would be that the "IsNegative" field is preventing zero-impression rows (and thus deleted keywords) from being returned. Try your report query with that field removed from the selector to see if that's really the case.

Cheers,
Dorian

Crosby (StoneTempleConsulting)

unread,
Aug 14, 2012, 6:44:52 PM8/14/12
to adwor...@googlegroups.com
Thanks for responding.

While I have a workaround, I didn't solve this the conventional way... (see below)

I would very much appreciate anyone's assistance.

What I am trying to do is use the reporting service to get a complete snapshot of my account's keywords, e.g.: all active, paused, deleted keywords.
I have to imagine this is quite possible (hopefully without resorting to API units?)

Part of the reason I am so eager on this is that the SEARCH_QUERY_PERFORMANCE_REPORT is returning AdGroup_ID/Keyword_ID combos that I can't get details on (databases tend to complain when an ID points at nothing...)

My workaround is to pull the below report over the lifetime of my data. (i.e.: set the start date to 2 years ago...)  It works. But YUCK.

Here we go then, any suggestions or edits much appreciated.
(For the record, I have tried adding/removing fields, etc.
The solution will either be stupid-obvious or kinda-crafty...???)

      ReportDefinition definition = new ReportDefinition
();
 
      definition.reportName = "Adwords_Keywords";
      definition.reportType = ReportDefinitionReportType.KEYWORDS_PERFORMANCE_REPORT;
      definition.downloadFormat = DownloadFormat.TSV;
      definition.dateRangeType = ReportDefinitionDateRangeType.CUSTOM_DATE;
 
      // http://code.google.com/apis/adwords/docs/appendix/reports.html
      Selector selector = new Selector();
      selector.fields = new string
[] {
            "AdGroupId"
            ,"Id"
            ,"IsNegative"
            ,"KeywordMatchType"
            ,"KeywordText"
            ,"Status"
            ,"ApprovalStatus"
            ,"QualityScore"
            ,"MaxCpc"
      };
 
      Predicate statusPredicate = new Predicate();
      statusPredicate.field = "Status";
      statusPredicate.@operator = PredicateOperator.IN;
      statusPredicate.values = new string[] { "DELETED" };
 
      selector.predicates = new Predicate[] { statusPredicate };
 
      selector.dateRange = dates;
      definition.selector = selector;
      definition.includeZeroImpressions = true;
      bool inMicros = false;

Thanks in advance,
~Crosby

Crosby (StoneTempleConsulting)

unread,
Aug 14, 2012, 6:45:47 PM8/14/12
to adwor...@googlegroups.com
(tried removing IsNegative, along with all sort of combos of other fields, to no avail...)

Danial Klimkin

unread,
Aug 17, 2012, 5:25:45 AM8/17/12
to adwor...@googlegroups.com
Hello Crosby,


It is only possible to retrieve a deleted criterion data if it had any impressions before it's deleted. If it had zero impressions, once deleted it is completely removed from the system.


-Danial, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages