dateRange of reportDefintion

280 views
Skip to first unread message

deadKenny2

unread,
Nov 2, 2017, 4:06:35 AM11/2/17
to AdWords API Forum
I dowlonload a official c# library for Adwordsd Api. adwords_dotnet_lib_src_v21.1.0. Using version 201705. The problem is that I cant find dateRange property for reportDefinition in reportDefinition.cs. Can you tell me how to set dateRange. Or if there is dateRange of reportdefinition in further versions. Or If api v201705 supports dateRange, how can i add in reportDefiniiotn Class to make thw soap get it.

Vincent Racaza (AdWords API Team)

unread,
Nov 2, 2017, 4:41:02 AM11/2/17
to AdWords API Forum
Hi,

For v201705 of C# client library, you can refer on this line in this reporting example (this is also the same in the latest version v201710) on how to set the date range type. As you can see on the example, the list of date range types is in the  ReportDefinitionDateRangeType object. You can also use AWQL in the services or in reports and the date range type is specified on the DURING clause as seen on this example.

Let me know if you have further clarifications.

Thanks,
Vincent
AdWords API Team

deadKenny2

unread,
Nov 2, 2017, 4:57:43 AM11/2/17
to AdWords API Forum
Vincent, maybe I formulated my problem in somewhat wrong way. There is CUSTOM_DATE in dateRangeType List. But I couldn't find the way to use it, cause there is no way to specify the dateRange itself using client library. Can you help me to get through this.

четверг, 2 ноября 2017 г., 11:41:02 UTC+3 пользователь Vincent Racaza (AdWords API Team) написал:

Vincent Racaza (AdWords API Team)

unread,
Nov 2, 2017, 6:23:30 AM11/2/17
to AdWords API Forum
Hi,

My apologies as I am not an expert in C#. However, you can just set the dateRange of your selector and set the min and max of your date range. Kindly refer to the sample report definition below with a custom date range:

<reportDefinition
       
xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201710">
       
<ns2:selector>
           
<ns2:fields>CampaignName</ns2:fields>
           
<ns2:fields>Impressions</ns2:fields>
         
  <ns2:dateRange>
               
<ns2:min>20171010</ns2:min>
               
<ns2:max>20171010</ns2:max>
           
</ns2:dateRange>

       
</ns2:selector>
       
<ns2:reportName>Placement performance report #1509617387588</ns2:reportName>
       
<ns2:reportType>CAMPAIGN_PERFORMANCE_REPORT</ns2:reportType>
       
<ns2:dateRangeType>CUSTOM_DATE</ns2:dateRangeType>
       
<ns2:downloadFormat>CSV</ns2:downloadFormat>
</reportDefinition>

For generating reports using AWQL, you can set the DURING clause this way:
DURING 20170317,20170317

deadKenny2

unread,
Nov 2, 2017, 7:42:58 AM11/2/17
to AdWords API Forum
Vincent, I use the client library. I would be gratefull, if someone will make clear the problem of dateRange in client library. I've tried to add dateRange in reportDefinition class of client library, but my knowledge of c# appeared to be poor. At least, may I ask Google fix it in further versions of client library. Or maybe library supports dateRange, but I missed it? Is there any possibility to make it clear? Thank you for your time.

четверг, 2 ноября 2017 г., 13:23:30 UTC+3 пользователь Vincent Racaza (AdWords API Team) написал:

deadKenny2

unread,
Nov 2, 2017, 8:24:29 AM11/2/17
to AdWords API Forum
Whatever I can get Stats for last 7 days and filter it by date. But anyway It would be good to make question clear.

четверг, 2 ноября 2017 г., 13:23:30 UTC+3 пользователь Vincent Racaza (AdWords API Team) написал:

Vincent Racaza (AdWords API Team)

unread,
Nov 2, 2017, 10:50:22 PM11/2/17
to AdWords API Forum
Hi,

You can use this example using AWQL instead as this is simpler (your whole report query is in one string) and you can just set your date range in the DURING clause (DURING 20171030, 20171101) as I have mentioned previously.

Kindly try this example and let us know if you need further assistance.

deadKenny2

unread,
Nov 3, 2017, 5:15:34 AM11/3/17
to AdWords API Forum
Hi, Vincent

I worked it out through client library. It works all the way good. It was totally my fault, I missed the structure, sorry for bothering.

пятница, 3 ноября 2017 г., 5:50:22 UTC+3 пользователь Vincent Racaza (AdWords API Team) написал:
Reply all
Reply to author
Forward
0 new messages