@@ -52,24 +52,21 @@ static void SampleRunReport(string propertyId="YOUR-GA4-PROPERTY-ID")
52
52
// Initialize request argument(s)
53
53
RunReportRequest request = new RunReportRequest
54
54
{
55
- Property = "property /" + propertyId ,
55
+ Property = "properties /" + propertyId ,
56
56
Dimensions = { new Dimension { Name = "city" } , } ,
57
57
Metrics = { new Metric { Name = "activeUsers" } , } ,
58
58
DateRanges = { new DateRange { StartDate = "2020-03-31" , EndDate = "today" } , } ,
59
59
} ;
60
60
61
61
// Make the request
62
- PagedEnumerable < RunReportResponse , DimensionHeader > response = client . RunReport ( request ) ;
62
+ var response = client . RunReport ( request ) ;
63
63
// [END analyticsdata_run_report]
64
64
65
65
// [START analyticsdata_run_report_response]
66
66
Console . WriteLine ( "Report result:" ) ;
67
- foreach ( RunReportResponse page in response . AsRawResponses ( ) )
67
+ foreach ( Row row in response . Rows )
68
68
{
69
- foreach ( Row row in page . Rows )
70
- {
71
- Console . WriteLine ( "{0}, {1}" , row . DimensionValues [ 0 ] . Value , row . MetricValues [ 0 ] . Value ) ;
72
- }
69
+ Console . WriteLine ( "{0}, {1}" , row . DimensionValues [ 0 ] . Value , row . MetricValues [ 0 ] . Value ) ;
73
70
}
74
71
// [END analyticsdata_run_report_response]
75
72
}
0 commit comments