我正在尝试使用库中提供的 Google Analytics 功能从 ASP.NET MVC 应用程序生成页面视图和事件。
似乎缺少文档,我无法理解如何发送页面视图和事件。在返回 a 的控制器中PartialViewResult
,我需要将页面视图发送到 Google Analytics 服务。
到目前为止,我只找到了两个如何使用他们的库的示例
- https://developers.google.com/api-client-library/dotnet/get_started
- https://developers.google.com/api-client-library/dotnet/guide/batch
然而,这些是针对各种其他 API 而不是 Google Analytics 的。例如,在日历 API 示例中有:calendarService.Events.Insert( event title, event description, time and date etc)
然后用于向用户的 Google 日历添加新条目。
例如,我不能简单地这样做:
Analytics analyticsService = new AnalyticsService();
analytics.PageViews.Send(client id, user browser, date time, etc);
我的问题:我如何实际使用 Google Analytics API 以与日历 API 类似的方式发送页面视图?合适的方法/类在哪里?