DateRangeType Custom_Date in C#

534 views
Skip to first unread message

rpay...@gmail.com

unread,
Mar 19, 2015, 5:09:10 AM3/19/15
to adwor...@googlegroups.com
Hi,

I'm using the 201409 client library to pull campaign performance reports and call details reports.  When I use any of the date presets, it works just fine, but when I try to use a custom date selector, this doesn't seem to work.  I've seen many solutions online that say to use something like what I've pasted below, but it doesn't seem to work for me.  Is there some new syntax or something that I should be using?

Thanks,
Mike


DateRange dateRange = new DateRange();
dateRange.min = DateTime.Now.AddDays(-1).ToString("yyyyMMdd");
dateRange.max = DateTime.Now.AddDays(-1).ToString("yyyyMMdd");
selector.dateRange = dateRange;

Danial Klimkin

unread,
Mar 19, 2015, 9:26:33 AM3/19/15
to adwor...@googlegroups.com
Hello Mike,


Do you also set DateTimeRange of the definition to CUSTOM_DATE?


-Danial, AdWords API Team.

rpay...@gmail.com

unread,
Mar 19, 2015, 2:52:48 PM3/19/15
to adwor...@googlegroups.com
Hi, Danial.

I don't see DateTimeRange, but I did set dateRangeType to CUSTOM_DATE.  Could this have been a typo on your end, or am I setting the wrong thing?

ReportDefinition def = new ReportDefinition();
def.reportType = ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT;
def.dateRangeType = ReportDefinitionDateRangeType.CUSTOM_DATE;


Thanks,
Mike

Danial Klimkin

unread,
Mar 20, 2015, 8:54:49 AM3/20/15
to adwor...@googlegroups.com
Hello Mike,


Correct, sorry I was typing from the top of my head.

Can you share the full definition? Also, what is the exact issue ("this doesn't seems to work"), do you get report for the wrong dates?


-Danial, AdWords API Team.

jat...@cisinlabs.com

unread,
Mar 22, 2016, 8:27:14 AM3/22/16
to AdWords API Forum


On Thursday, March 19, 2015 at 6:56:33 PM UTC+5:30, Danial Klimkin wrote:
Hello Danial how can i set the DateTimeRange in the DD/MM/YY format
Do you also set DateTimeRange of the definition to CUSTOM_DATE?
-Danial, AdWords API Team.

                reportName = "CRITERIA_PERFORMANCE_REPORT",
                reportType = ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT,
                dateRangeType = ReportDefinitionDateRangeType.CUSTOM_DATE,
                downloadFormat = DownloadFormat.CSVFOREXCEL,
                selector = new Selector()
                {
                    fields = new string[] {"CampaignId", "CampaignName","CampaignStatus","AdGroupId",
                       "AdGroupName","AdGroupStatus","Id","Criteria","Clicks", "Conversions", "Cost"},
                    dateRange = new DateRange { min = start.ToString(@"yyyyMMdd"), max = start.ToString(@"yyyyMMdd") },
                  predicates = new Predicate[] {
                 Predicate.In("Status", new string[] {"ENABLED"}) 


Cyber Infrastructure (P) Limited, [CIS] (CMMI Level 3 Certified)

Central India's largest Technology Company.

Ensuring your success through our highly optimizedTechnology solutions.

www.cisin.com | +Cisin | Linkedin | Offices:  India | USA | Singapore | South Africa.


*** Please note that this message and any attachments may contain confidential and proprietary material and information and are intended only for the use of the intended recipient(s). If you are not the one, you should delete it immediately to avoid any copy write issues. 

Umesh Dengale

unread,
Apr 6, 2016, 11:35:14 AM4/6/16
to AdWords API Forum
Hello,

Could you explain in details the CRITERIA_PERFORMANCE_REPORT issue? Are you not getting the report data for specific dates? In case of any issue, please provide me privately the clientCustomerId. Just click Reply privately to author in the forum when responding.

Thanks,
Umesh, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages