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() ); }
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); }