Hello Mike,
dateRange is a part of selector, not definition. So you need smth like: report_definition = { :selector => { :fields => ['AccountDescriptiveName', 'AccountId', 'CampaignName', 'Impressions', 'Clicks', 'ConversionRate', 'Conversions'], :date_range => {:min => "20140121", :max => "20140123"}, }, :report_name => "Campaign Report", :report_type => 'CAMPAIGN_PERFORMANCE_REPORT', :download_format => 'XML', :date_range_type => 'CUSTOM_DATE', # Enable to get rows with zero impressions. :include_zero_impressions => false } Generally, for Ruby lib this error means the field was not expected in this place. -Danial, AdWords API Team. On Wednesday, January 29, 2014 3:09:22 AM UTC+4, Mike C wrote: > > I'm grabbing campaign stats via the API (reporting) and I'm utilizing the > parallel_report_download method shown here: > https://github.com/googleads/google-api-ads-ruby/blob/master/adwords_api/examples/v201309/reporting/parallel_report_download.rb > > When I set a custom date range I am getting the error "Missing elements in > :order! [:date_range]" and I am having trouble figuring this out. > > My Report Definition: > > report_definition = { > :selector => { > :fields => ['AccountDescriptiveName', 'AccountId', 'CampaignName', > 'Impressions', 'Clicks', 'ConversionRate', 'Conversions'], > }, > :report_name => "Campaign Report", > :report_type => 'CAMPAIGN_PERFORMANCE_REPORT', > :download_format => 'XML', > :date_range_type => 'CUSTOM_DATE', > :date_range => {:min => "20140121", :max => "20140123"}, > # Enable to get rows with zero impressions. > :include_zero_impressions => false > } > > The error is pointing to this line in the method example > "report_utils.download_report_as_file(local_def, file_name, cid)" > > Line 104 - > https://github.com/googleads/google-api-ads-ruby/blob/master/adwords_api/examples/v201309/reporting/parallel_report_download.rb > > Everything works fine if I set the :date_range_type to a predetermined > data set (Last 7 days, etc.) but I need users to set a custom date. > > Thanks for the help! > > Mike > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.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 --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.