コード例 #1
0
        public void SetCustomVariable(int position, string name, string value, int scope=3)
        {
            if (position < 1 || position > 5)
                throw new ArgumentOutOfRangeException(string.Format("position {0} - {1}", position, "Must be between 1 and 5"));
            if (scope < 1 || scope > 3)
                throw new ArgumentOutOfRangeException(string.Format("scope {0} - {1}", scope, "Must be between 1 and 3"));

            CustomVariables[position - 1] = new CustomVariable(name, value, scope);
        }
コード例 #2
0
        public void SetCustomVariable(int position, string name, string value, int scope = 3)
        {
            if (position < 1 || position > 5)
            {
                throw new ArgumentOutOfRangeException(string.Format("position {0} - {1}", position, "Must be between 1 and 5"));
            }
            if (scope < 1 || scope > 3)
            {
                throw new ArgumentOutOfRangeException(string.Format("scope {0} - {1}", scope, "Must be between 1 and 3"));
            }

            CustomVariables[position - 1] = new CustomVariable(name, value, scope);
        }
コード例 #3
0
        public TrackerBase(string trackingAccount, string trackingDomain, IAnalyticsSession analyticsSession, ITrackerEnvironment trackerEnvironment)
        {
            TrackingAccount = trackingAccount;
            TrackingDomain = trackingDomain;
            AnalyticsSession = analyticsSession;

            Hostname = trackerEnvironment.Hostname;
            Language = "en";
            UserAgent = string.Format("GoogleAnalyticsTracker/2.0 ({0}; {1}; {2})", trackerEnvironment.OsPlatform, trackerEnvironment.OsVersion, trackerEnvironment.OsVersionString);

            CookieContainer = new CookieContainer();

            ThrowOnErrors = false;

            InitializeCharset();

            CustomVariables = new CustomVariable[5];

            _utmeGenerator = new UtmeGenerator(this);
        }
コード例 #4
0
        public TrackerBase(string trackingAccount, string trackingDomain, IAnalyticsSession analyticsSession, ITrackerEnvironment trackerEnvironment)
        {
            TrackingAccount  = trackingAccount;
            TrackingDomain   = trackingDomain;
            AnalyticsSession = analyticsSession;

            Hostname  = trackerEnvironment.Hostname;
            Language  = "en";
            UserAgent = string.Format("GoogleAnalyticsTracker/2.0 ({0}; {1}; {2})", trackerEnvironment.OsPlatform, trackerEnvironment.OsVersion, trackerEnvironment.OsVersionString);

            CookieContainer = new CookieContainer();

            ThrowOnErrors = false;

            InitializeCharset();

            CustomVariables = new CustomVariable[5];

            _utmeGenerator = new UtmeGenerator(this);
        }
コード例 #5
0
 public void ClearCustomVariables()
 {
     CustomVariables = new CustomVariable[5];
 }