Skip to content

Commit

Permalink
fix issue #8
Browse files Browse the repository at this point in the history
Code didn't compile, and Property path was incorrect.
  • Loading branch information
surferjeff authored and ikuleshov committed Oct 28, 2021
1 parent ceb128c commit 26d740a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions analytics-data/QuickStart/QuickStart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,21 @@ static void SampleRunReport(string propertyId="YOUR-GA4-PROPERTY-ID")
// Initialize request argument(s)
RunReportRequest request = new RunReportRequest
{
Property = "property/" + propertyId,
Property = "properties/" + propertyId,
Dimensions = { new Dimension{ Name="city"}, },
Metrics = { new Metric{ Name="activeUsers"}, },
DateRanges = { new DateRange{ StartDate="2020-03-31", EndDate="today"}, },
};

// Make the request
PagedEnumerable<RunReportResponse, DimensionHeader> response = client.RunReport(request);
var response = client.RunReport(request);
// [END analyticsdata_run_report]

// [START analyticsdata_run_report_response]
Console.WriteLine("Report result:");
foreach(RunReportResponse page in response.AsRawResponses())
foreach(Row row in response.Rows)
{
foreach(Row row in page.Rows)
{
Console.WriteLine("{0}, {1}", row.DimensionValues[0].Value, row.MetricValues[0].Value);
}
Console.WriteLine("{0}, {1}", row.DimensionValues[0].Value, row.MetricValues[0].Value);
}
// [END analyticsdata_run_report_response]
}
Expand Down

0 comments on commit 26d740a

Please sign in to comment.