-
Encountering GRPC Connection Issue with Google Analytics Data V1Beta
I’m encountering a GRPC error while attempting to utilize the GA4 analytics API following the API quickstart guide. The specific error message is: Grpc.Core.RpcException: ‘Status(StatusCode=”Unavailable”, Detail=”failed to connect to all addresses”, DebugException=”Grpc.Core.Internal.CoreErrorDetailException: {“created”:”@1686669889.017000000″,”description”:”Failed to pick subchannel”,”file”:”……srccoreextfiltersclient_channelclient_channel.cc”,”file_line”:3218,”referenced_errors”:[{“created”:”@1686669889.017000000″,”description”:”failed to connect to all addresses”,”file”:”……srccorelibtransporterror_utils.cc”,”file_line”:165,”grpc_status”:14}]}”)’
Do you have any suggestions or advice on how to resolve this issue?
Here is a snippet of the code I’m currently using:
BetaAnalyticsDataClient client = BetaAnalyticsDataClient.Create(); RunReportRequest request = new RunReportRequest { Property = "properties/" + propertyId, Dimensions = { new Dimension { Name = "city" }, }, Metrics = { new Metric { Name = "activeUsers" }, }, DateRanges = { new DateRange { StartDate = "2020-03-31", EndDate = "today" }, }, }; try { var response = client.RunReport(request); Console.WriteLine("Report result:"); foreach (Row row in response.Rows) { Console.WriteLine("{0}, {1}", row.DimensionValues[0].Value, row.MetricValues[0].Value); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); throw; }
Log in to reply.