コード例 #1
0
        /// <summary>
        /// Builds the request.
        /// </summary>
        /// <param name="pageView">The page view.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public TrackingRequest BuildRequest(GaDotNet.Common.Data.GooglePageView pageView, HttpContext context)
        {
            var r = BuildRequest(pageView);

            // add users IP address
            r.RequestedByIpAddress = context.Request.UserHostAddress;

            return r;
        }
コード例 #2
0
ファイル: RequestFactory.cs プロジェクト: lukesmith/Ga.net
 /// <summary>
 /// Builds the tracking request from a Google Event.
 /// </summary>
 /// <param name="googleEvent">The google event.</param>
 /// <returns></returns>
 public TrackingRequest BuildRequest(GaDotNet.Common.Data.GoogleEvent googleEvent)
 {
     var r = new TrackingRequest();
     
     r.AnalyticsAccountCode = ConfigurationSettings.GoogleAccountCode;
     r.TrackingEvent = googleEvent;
     
     return r;
 }
コード例 #3
0
        /// <summary>
        /// Builds the request from a page view request and the appSettings 'GoogleAnalyticsAccountCode'
        /// </summary>
        /// <param name="pageView">The page view.</param>
        /// <returns></returns>
        public TrackingRequest BuildRequest(GaDotNet.Common.Data.GooglePageView pageView)
        {
            var r = new TrackingRequest();

            r.PageTitle = pageView.PageTitle;
            r.PageDomain = pageView.DomainName;
            r.AnalyticsAccountCode = ConfigurationSettings.GoogleAccountCode;
            r.PageUrl = pageView.Url;

            return r;
        }
コード例 #4
0
        /// <summary>
        /// Builds the tracking request from a Google Transaction.
        /// </summary>
        /// <param name="googleTransaction">The google transaction.</param>
        /// <returns></returns>
        public TrackingRequest BuildRequest(GaDotNet.Common.Data.GoogleTransaction googleTransaction)
        {
            var r = new TrackingRequest();

            r.AnalyticsAccountCode = ConfigurationSettings.GoogleAccountCode;
            r.TrackingTransaction = googleTransaction;

            return r;
        }
コード例 #5
0
        /// <summary>
        /// Builds the tracking request from a Google Event.
        /// </summary>
        /// <param name="googleEvent">The google event.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public TrackingRequest BuildRequest(GaDotNet.Common.Data.GoogleEvent googleEvent, HttpContext context)
        {
            var r = BuildRequest(googleEvent);

            r.RequestedByIpAddress = context.Request.UserHostAddress;

            return r;
        }