Esempio n. 1
0
        /// <summary>
        /// Creates a new instance of the TealiumSettings object.  The account, profile, and environment
        /// properties are required and must be specified.
        /// </summary>
        /// <param name="account">The Tealium account name for your company.</param>
        /// <param name="profile">The reporting profile for your application.</param>
        /// <param name="environment">The reporting environment for your application (i.e. "Dev", "QA", "Prod").</param>
        /// <param name="baseVariables">Static variables to be used on all metric calls.</param>
        public TealiumSettings(string account, string profile, TealiumEnvironment environment, Dictionary<string, object> baseVariables = null)
        {
            if (string.IsNullOrWhiteSpace(account) || string.IsNullOrWhiteSpace(profile))
                TealiumStatusLog.Error("The Account, Profile, and Environment settings are required when initializing a new Settings instance.");

            this.Account = account;
            this.Profile = profile;
            this.Environment = environment;
            this.BaseVariables = baseVariables;

            //set defaults for the rest of the settings.
            #if NETFX_CORE
            this.EnableOfflineMode = true;
            #endif
            this.AutoTrackPageViews = true;
            this.UseSSL = false;
            // ViewMetricEventName = Constants.DEFAULT_VIEW_EVENT_NAME;
            ClickMetricEventName = Constants.DEFAULT_CLICK_EVENT_NAME;
            ViewMetricIdParam = Constants.DEFAULT_VIEW_ID_PARAM;
            ClickMetricIdParam = Constants.DEFAULT_CLICK_ID_PARAM;
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new instance of the TealiumSettings object.  The account, profile, and environment
        /// properties are required and must be specified.
        /// </summary>
        /// <param name="account">The Tealium account name for your company.</param>
        /// <param name="profile">The reporting profile for your application.</param>
        /// <param name="environment">The reporting environment for your application (i.e. "Dev", "QA", "Prod").</param>
        /// <param name="baseVariables">Static variables to be used on all metric calls.</param>
        public TealiumSettings(string account, string profile, TealiumEnvironment environment, Dictionary <string, object> baseVariables = null)
        {
            if (string.IsNullOrWhiteSpace(account) || string.IsNullOrWhiteSpace(profile))
            {
                TealiumStatusLog.Error("The Account, Profile, and Environment settings are required when initializing a new Settings instance.");
            }

            this.Account       = account;
            this.Profile       = profile;
            this.Environment   = environment;
            this.BaseVariables = baseVariables;

            //set defaults for the rest of the settings.
#if NETFX_CORE
            this.EnableOfflineMode = true;
#endif
            this.AutoTrackPageViews = true;
            this.UseSSL             = false;
            // ViewMetricEventName = Constants.DEFAULT_VIEW_EVENT_NAME;
            ClickMetricEventName = Constants.DEFAULT_CLICK_EVENT_NAME;
            ViewMetricIdParam    = Constants.DEFAULT_VIEW_ID_PARAM;
            ClickMetricIdParam   = Constants.DEFAULT_CLICK_ID_PARAM;
        }
Esempio n. 3
0
        private object GetEnvironmentString(TealiumEnvironment tealiumEnvironment)
        {
            string env = string.Empty;

            switch (tealiumEnvironment)
            {
            case TealiumEnvironment.TealiumTargetDev:
                env = Constants.ENV_DEV;
                break;

            case TealiumEnvironment.TealiumTargetQA:
                env = Constants.ENV_QA;
                break;

            case TealiumEnvironment.TealiumTargetProd:
                env = Constants.ENV_PROD;
                break;

            default:
                env = Constants.ENV_DEV;
                break;
            }
            return(env);
        }
Esempio n. 4
0
 private object GetEnvironmentString(TealiumEnvironment tealiumEnvironment)
 {
     string env = string.Empty;
     switch (tealiumEnvironment)
     {
         case TealiumEnvironment.TealiumTargetDev:
             env = Constants.ENV_DEV;
             break;
         case TealiumEnvironment.TealiumTargetQA:
             env = Constants.ENV_QA;
             break;
         case TealiumEnvironment.TealiumTargetProd:
             env = Constants.ENV_PROD;
             break;
         default:
             env = Constants.ENV_DEV;
             break;
     }
     return env;
 }