コード例 #1
0
 public static void TrackPageViewAsync(this Tracker tracker, HttpRequestMessage httpRequest, string pageTitle, string pageUrl)
 {
     tracker.TrackPageViewAsync(pageTitle, pageUrl,
                                hostname: httpRequest.RequestUri.Host,
                                userAgent: httpRequest.Headers.UserAgent.ToString(),
                                language: httpRequest.Headers.AcceptLanguage.ToString()
                                );
 }
コード例 #2
0
        public static void TrackPageViewAsync(this Tracker tracker, HttpContextBase httpContext, string pageTitle, string pageUrl)
        {
            var request = httpContext.Request;

            tracker.Hostname  = request.Url.Host;
            tracker.UserAgent = request.UserAgent;
            tracker.Language  = request.UserLanguages != null?string.Join(";", request.UserLanguages) : "";

            tracker.TrackPageViewAsync(pageTitle, pageUrl);
        }