Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!ABTestInfoProvider.ABTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblABTestingDisabled.Text = GetString("abtesting.disabled");
        }

        int nodeID = QueryHelper.GetInteger("nodeID", 0);

        int testID = QueryHelper.GetInteger("abTestId", 0);

        listElem.TestID = testID;
        // Prepare the actions
        string[,] actions = new string[1, 6];
        actions[0, 0]     = HeaderActions.TYPE_HYPERLINK;
        actions[0, 1]     = ResHelper.GetString("abtesting.variant.new");
        actions[0, 3]     = ResolveUrl("Edit.aspx?abtestID=" + testID + "&nodeid=" + nodeID);
        actions[0, 5]     = GetImageUrl("Objects/CMS_Variant/add.png");

        // Set the actions
        ICMSMasterPage master = this.CurrentMaster;

        master.HeaderActions.Actions = actions;
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!ABTestInfoProvider.ABTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblABTestingDisabled.Text = GetString("abtesting.disabled");
        }

        // Prepare the breadcrumbs
        string[,] breadcrumbs = new string[2, 3];
        breadcrumbs[0, 0]     = GetString("abtesting.abtest.list");
        breadcrumbs[0, 1]     = "~/CMSModules/OnlineMarketing/Pages/Content/ABTesting/ABTest/List.aspx?nodeid=" + NodeID;
        breadcrumbs[1, 0]     = GetString("abtesting.abtest.new");

        // Set the title
        PageTitle title = this.CurrentMaster.Title;

        title.Breadcrumbs   = breadcrumbs;
        title.HelpTopicName = "abtest_general";

        editElem.AliasPath = QueryHelper.GetString("AliasPath", String.Empty);

        this.editElem.OnSaved += new EventHandler(editElem_OnSaved);
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckWebAnalyticsUI(QueryHelper.GetString("datacodename", String.Empty));

        ucDisplayReport = LoadControl("~/CMSModules/Reporting/Controls/DisplayReport.ascx") as IDisplayReport;
        pnlDisplayReport.Controls.Add((Control)ucDisplayReport);

        CurrentMaster.PanelContent.CssClass = "";
        UIHelper.AllowUpdateProgress = false;

        String siteName = CMSContext.CurrentSiteName;

        // Text for menu
        mSave = GetString("general.save");
        mPrint = GetString("Analytics_Report.Print");
        mDeleteData = GetString("Analytics_Report.ManageData");

        // Images for menu buttons
        imgSave.ImageUrl = GetImageUrl("CMSModules/CMS_Content/EditMenu/save_small.png");
        imgPrint.ImageUrl = GetImageUrl("General/printSmall.png");
        imgManageData.ImageUrl = GetImageUrl("CMSModules/CMS_Reporting/managedataSmall.png");

        // Check 'ManageData' permission
        if (CMSContext.CurrentUser.IsAuthorizedPerResource("CMS.WebAnalytics", "ManageData"))
        {
            this.lnkDeleteData.OnClientClick = "modalDialog('" +
            ResolveUrl("~/CMSModules/Reporting/WebAnalytics/Analytics_ManageData.aspx") +
            "?statcodename=mvtest', 'AnalyticsManageData', " + AnalyticsHelper.MANAGE_WINDOW_WIDTH + ", " + AnalyticsHelper.MANAGE_WINDOW_HEIGHT + "); return false; ";
            this.lnkDeleteData.Visible = true;
        }

        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "myModalDialog",
        ScriptHelper.GetScript("function myModalDialog(url, name, width, height) { " +
            "win = window; " +
            "var dHeight = height; var dWidth = width; " +
            "if (( document.all )&&(navigator.appName != 'Opera')) { " +
            "try { win = wopener.window; } catch (e) {} " +
            "if ( parseInt(navigator.appVersion.substr(22, 1)) < 7 ) { dWidth += 4; dHeight += 58; }; " +
            "dialog = win.showModalDialog(url, this, 'dialogWidth:' + dWidth + 'px;dialogHeight:' + dHeight + 'px;resizable:yes;scroll:yes'); " +
            "} else { " +
            "oWindow = win.open(url, name, 'height=' + dHeight + ',width=' + dWidth + ',toolbar=no,directories=no,menubar=no,modal=yes,dependent=yes,resizable=yes,scroll=yes,scrollbars=yes'); oWindow.opener = this; oWindow.focus(); } } "));


        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!MVTestInfoProvider.MVTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblMVTestingDisabled.Text = GetString("mvt.disabled");
        }

        ucMVTests.ReturnColumnName = "MVTestName";
        ucMVTests.AllowEmpty = false;
        ucMVTests.PostbackOnChange = true;
    }
Esempio n. 4
0
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check UI Permissions
        if ((CMSContext.CurrentUser == null) || (!CMSContext.CurrentUser.IsAuthorizedPerUIElement("CMS.Content", "OnlineMarketing.MVTVariants")))
        {
            RedirectToCMSDeskUIElementAccessDenied("CMS.Content", "OnlineMarketing.MVTVariants");
        }

        if (DataHelper.GetNotEmpty(URLHelper.GetCurrentDomain(), "") != "")
        {
            LicenseHelper.CheckFeatureAndRedirect(URLHelper.GetCurrentDomain(), FeatureEnum.MVTesting);
        }

        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblWADisabled.Text  = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!MVTestInfoProvider.MVTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblMVTestingDisabled.Text = GetString("mvt.disabled");
        }
    }
Esempio n. 5
0
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!MVTestInfoProvider.MVTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblMVTestingDisabled.Text = GetString("mvt.disabled");
        }

        // Get the alias path of the current node
        if (Node != null)
        {
            editElem.AliasPath = Node.NodeAliasPath;
        }
        else
        {
            editElem.StopProcessing = true;
        }

        editElem.MVTestID = QueryHelper.GetInteger("mvtestId", 0);
        editElem.OnSaved += new EventHandler(editElem_OnSaved);
    }
Esempio n. 6
0
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        // Show or hide messages
        this.lblError.Visible = !string.IsNullOrEmpty(this.lblError.Text);
        this.lblInfo.Visible  = !string.IsNullOrEmpty(this.lblInfo.Text);

        string status = string.Empty;

        // Set status
        if (AbTestObj != null)
        {
            if (!AbTestObj.ABTestEnabled)
            {
                status = "<span class=\"StatusDisabled\">" + GetString("general.disabled") + "</span>";
            }
            else
            {
                if (ABTestInfoProvider.ABTestIsRunning(AbTestObj))
                {
                    // Display disabled information
                    if (!AnalyticsHelper.AnalyticsEnabled(CMSContext.CurrentSiteName) ||
                        !AnalyticsHelper.TrackConversionsEnabled(CMSContext.CurrentSiteName))
                    {
                        status = GetString("abtesting.statusNone");
                    }
                    else
                    {
                        if (!ABTestInfoProvider.ContainsVariants(AbTestObj))
                        {
                            // Display warning when the test does not contain any variant
                            status = "<img src=\"" + GetImageUrl("Design/Controls/UniGrid/Actions/Warning.png") + "\" alt=\"" + GetString("abtest.novariants") + "\" title=\""
                                     + GetString("abtest.novariants") + "\" />&nbsp;&nbsp;"
                                     + GetString("abtesting.statusNone");
                        }
                        else
                        {
                            status = "<span class=\"StatusEnabled\">" + GetString("abtesting.status" + ABTestInfoProvider.GetABTestStatus(AbTestObj)) + "</span>";
                        }
                    }
                }
                else
                {
                    status = GetString("abtesting.status" + ABTestInfoProvider.GetABTestStatus(AbTestObj));
                }
            }
        }
        else
        {
            status = GetString("general.none");
        }

        ltrStatusValue.Text = status;
    }
Esempio n. 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (AnalyticsHelper.AnalyticsEnabled(CMSContext.CurrentSiteName))
     {
         URLHelper.Redirect("default.aspx");
     }
     else
     {
         this.lblInfo.Text = GetString("WebAnalytics.Disabled");
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (AnalyticsHelper.AnalyticsEnabled(SiteContext.CurrentSiteName))
     {
         URLHelper.Redirect(UrlResolver.ResolveUrl("default.aspx"));
     }
     else
     {
         ShowWarning(GetString("WebAnalytics.Disabled"));
     }
 }
Esempio n. 9
0
    void viewBiz_OnAfterSave(object sender, EventArgs e)
    {
        if (this.TrackConversionName != String.Empty)
        {
            string siteName = CMSContext.CurrentSiteName;

            if (AnalyticsHelper.AnalyticsEnabled(siteName) && AnalyticsHelper.TrackConversionsEnabled(siteName) && !AnalyticsHelper.IsIPExcluded(siteName, HTTPHelper.UserHostAddress))
            {
                HitLogProvider.LogConversions(CMSContext.CurrentSiteName, CMSContext.PreferredCultureCode, this.TrackConversionName, 0, ConversionValue);
            }
        }
    }
Esempio n. 10
0
    private void viewBiz_OnAfterSave(object sender, EventArgs e)
    {
        if (TrackConversionName != String.Empty)
        {
            string siteName = SiteContext.CurrentSiteName;

            if (AnalyticsHelper.AnalyticsEnabled(siteName) && !AnalyticsHelper.IsIPExcluded(siteName, RequestContext.UserHostAddress))
            {
                HitLogProvider.LogConversions(SiteContext.CurrentSiteName, LocalizationContext.PreferredCultureCode, TrackConversionName, 0, ConversionValue);
            }
        }
    }
Esempio n. 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!ABTestInfoProvider.ABTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblABTestingDisabled.Text = GetString("abtesting.disabled");
        }

        if (!AnalyticsHelper.TrackConversionsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblTrackConversionsDisabled.Text = GetString("webanalytics.tackconversionsdisabled");
        }

        listElem.ShowFilter    = false;
        UIContext.AnalyticsTab = AnalyticsTabEnum.ABTests;

        listElem.NodeID = NodeID;

        // Get the alias path of the current node
        string aliasPath = String.Empty;

        if (this.Node != null)
        {
            aliasPath          = Node.NodeAliasPath;
            listElem.AliasPath = aliasPath;
        }
        else
        {
            listElem.StopProcessing = true;
        }

        // Prepare the actions
        string[,] actions = new string[1, 6];
        actions[0, 0]     = HeaderActions.TYPE_HYPERLINK;
        actions[0, 1]     = ResHelper.GetString("abtesting.abtest.new");
        actions[0, 3]     = ResolveUrl("new.aspx?nodeID=" + NodeID + "&AliasPath=" + aliasPath);
        actions[0, 5]     = GetImageUrl("Objects/OM_AbTest/add.png");

        // Set the actions
        ICMSMasterPage master = this.CurrentMaster;

        master.HeaderActions.Actions = actions;
    }
Esempio n. 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check UI Analytics.Settings
        CurrentUserInfo ui = CMSContext.CurrentUser;

        if (!ui.IsAuthorizedPerUIElement("CMS.Content", "Analytics.Settings"))
        {
            RedirectToCMSDeskUIElementAccessDenied("CMS.Content", "Analytics.Settings");
        }

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(CMSContext.CurrentSiteName))
        {
            this.pnlWarning.Visible = true;
            this.lblWarning.Text    = ResHelper.GetString("WebAnalytics.Disabled");
        }

        ucConversionSelector.SelectionMode = SelectionModeEnum.SingleTextBox;
        ucConversionSelector.IsLiveSite    = false;

        nodeID = QueryHelper.GetInteger("nodeid", 0);
        mSave  = GetString("general.save");

        UIContext.AnalyticsTab = AnalyticsTabEnum.Settings;

        tree = new TreeProvider(CMSContext.CurrentUser);
        node = tree.SelectSingleNode(nodeID, CMSContext.PreferredCultureCode, tree.CombineWithDefaultCulture);

        if (ui.IsAuthorizedPerDocument(node, NodePermissionsEnum.Read) == AuthorizationResultEnum.Denied)
        {
            RedirectToAccessDenied(String.Format(GetString("cmsdesk.notauthorizedtoreaddocument"), node.NodeAliasPath));
        }

        // Check modify permissions
        else if (ui.IsAuthorizedPerDocument(node, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Denied)
        {
            lblInfo.Visible = true;
            lblInfo.Text    = String.Format(GetString("cmsdesk.notauthorizedtoeditdocument"), node.NodeAliasPath);

            // Disable save button
            btnSave.Enabled          = false;
            usSelectCampaign.Enabled = false;
        }

        if (node != null)
        {
            if (!URLHelper.IsPostback())
            {
                ReloadData();
            }
        }
    }
Esempio n. 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CurrentMaster.PanelContent.CssClass = "";

        statCodeName = QueryHelper.GetString("statCodeName", String.Empty);
        dataCodeName = QueryHelper.GetString("dataCodeName", String.Empty);

        ucDisplayReport = LoadControl("~/CMSModules/Reporting/Controls/DisplayReport.ascx") as IDisplayReport;
        pnlDisplayReport.Controls.Add((Control)ucDisplayReport);

        CheckWebAnalyticsUI(dataCodeName);

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(CMSContext.CurrentSiteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = ResHelper.GetString("WebAnalytics.Disabled");
        }

        // Text for menu buttons
        mSave  = GetString("general.save");
        mPrint = GetString("Analytics_Report.Print");

        // Images for menu buttons
        imgSave.ImageUrl  = GetImageUrl("CMSModules/CMS_Content/EditMenu/save_small.png");
        imgPrint.ImageUrl = GetImageUrl("General/printSmall.png");

        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "myModalDialog",
                                               ScriptHelper.GetScript("function myModalDialog(url, name, width, height) { " +
                                                                      "win = window; " +
                                                                      "var dHeight = height; var dWidth = width; " +
                                                                      "if (( document.all )&&(navigator.appName != 'Opera')) { " +
                                                                      "try { win = wopener.window; } catch (e) {} " +
                                                                      "if ( parseInt(navigator.appVersion.substr(22, 1)) < 7 ) { dWidth += 4; dHeight += 58; }; " +
                                                                      "dialog = win.showModalDialog(url, this, 'dialogWidth:' + dWidth + 'px;dialogHeight:' + dHeight + 'px;resizable:yes;scroll:yes'); " +
                                                                      "} else { " +
                                                                      "oWindow = win.open(url, name, 'height=' + dHeight + ',width=' + dWidth + ',toolbar=no,directories=no,menubar=no,modal=yes,dependent=yes,resizable=yes,scroll=yes,scrollbars=yes'); oWindow.opener = this; oWindow.focus(); } } "));

        CurrentMaster.Title.TitleText = GetString("analytics_codename.campaign") + " - " + GetString("analytics_codename." + statCodeName);

        // Icon
        string iconName = QueryHelper.GetString("icon", String.Empty);
        string imageUrl = GetImageUrl("CMSModules/CMS_WebAnalytics/Details/" + iconName + ".png");

        if (!FileHelper.FileExists(imageUrl))
        {
            imageUrl = GetImageUrl("Objects/Reporting_ReportCategory/object.png");
        }

        CurrentMaster.Title.TitleImage    = imageUrl;
        CurrentMaster.Title.HelpTopicName = Server.UrlEncode(statCodeName).Replace(".", "_");
    }
Esempio n. 14
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        // Log hit only if we are on the live site and banner is not reused from previous request
        if ((currentViewMode == CMS.PortalEngine.ViewModeEnum.LiveSite) && (banner != null) && !bannerReused)
        {
            string currentSiteName = CMSContext.CurrentSiteName;

            if (AnalyticsHelper.AnalyticsEnabled(currentSiteName))
            {
                HitLogProvider.LogHit("bannerhit", currentSiteName, null, null, banner.BannerID);
            }
        }
    }
Esempio n. 15
0
    /// <summary>
    /// After voted event.
    /// </summary>
    private void viewPoll_OnAfterVoted(object sender, EventArgs e)
    {
        // Log track conversion
        if (!String.IsNullOrEmpty(TrackConversionName))
        {
            string siteName = SiteContext.CurrentSiteName;

            if (AnalyticsHelper.AnalyticsEnabled(siteName) && AnalyticsHelper.TrackConversionsEnabled(siteName) && !AnalyticsHelper.IsIPExcluded(siteName, RequestContext.UserHostAddress))
            {
                HitLogProvider.LogConversions(siteName, LocalizationContext.PreferredCultureCode, TrackConversionName, 0, ConversionValue);
            }
        }
    }
Esempio n. 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        listElem.EditPage = "frameset.aspx";

        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!MVTestInfoProvider.MVTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblMVTestingDisabled.Text = GetString("mvt.disabled");
        }

        if (!AnalyticsHelper.TrackConversionsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblTrackConversionsDisabled.Text = GetString("webanalytics.tackconversionsdisabled");
        }

        // Set NodeID in order to check the access to the document
        listElem.NodeID = NodeID;

        // Get the alias path of the current node
        if (this.Node != null)
        {
            listElem.AliasPath = Node.NodeAliasPath;
        }
        else
        {
            listElem.StopProcessing = true;
        }

        // Prepare the actions
        string[,] actions = new string[1, 6];
        actions[0, 0]     = HeaderActions.TYPE_HYPERLINK;
        actions[0, 1]     = GetString("mvtest.new");
        actions[0, 3]     = ResolveUrl("new.aspx?nodeid=" + NodeID);
        actions[0, 5]     = GetImageUrl("Objects/OM_MVTest/add.png");

        // Set the actions
        ICMSMasterPage master = this.CurrentMaster;

        master.HeaderActions.Actions = actions;
    }
Esempio n. 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!ABTestInfoProvider.ABTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblABTestingDisabled.Text = GetString("abtesting.disabled");
        }

        PageTitle title  = this.CurrentMaster.Title;
        int       testID = QueryHelper.GetInteger("abTestID", 0);

        editElem.TestID = testID;


        // Prepare the header
        string name = "";

        title.HelpTopicName = "variant_edit";
        if (editElem.VariantObj != null)
        {
            name             = editElem.VariantObj.ABVariantDisplayName;
            title.TitleImage = GetImageUrl("Objects/CMS_Variant/object.png");
        }
        else
        {
            name             = GetString("abtesting.variant.new");
            title.TitleImage = GetImageUrl("Objects/CMS_Variant/new.png");
        }

        nodeID = QueryHelper.GetInteger("nodeID", 0);
        // Prepare the breadcrumbs
        string[,] breadcrumbs = new string[2, 3];
        breadcrumbs[0, 0]     = GetString("abtesting.variant.list");
        breadcrumbs[0, 1]     = "~/CMSModules/OnlineMarketing/Pages/Content/ABTesting/ABVariant/List.aspx?abTestID=" + testID + "&nodeid=" + nodeID;
        breadcrumbs[1, 0]     = name;

        // Set the title
        title.Breadcrumbs = breadcrumbs;
    }
Esempio n. 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckWebAnalyticsUI("ABTest.Overview");

        ucDisplayReport = LoadControl("~/CMSModules/Reporting/Controls/DisplayReport.ascx") as IDisplayReport;
        pnlOverview.Controls.Add((Control)ucDisplayReport);

        ucConversionRateReport = LoadControl("~/CMSModules/Reporting/Controls/DisplayReport.ascx") as IDisplayReport;
        pnlConversionRate.Controls.Add((Control)ucConversionRateReport);

        ucTestValuesReport = LoadControl("~/CMSModules/Reporting/Controls/DisplayReport.ascx") as IDisplayReport;
        pnlConversionValue.Controls.Add((Control)ucTestValuesReport);

        listElem.ShowObjectMenu             = false;
        CurrentMaster.PanelContent.CssClass = "";
        String siteName = CMSContext.CurrentSiteName;

        UIHelper.AllowUpdateProgress = false;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!ABTestInfoProvider.ABTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblABTestingDisabled.Text = GetString("abtesting.disabled");
        }

        listElem.ShowFilter    = false;
        listElem.DelayedReload = true;
        listElem.Grid.GridName = "~/CMSModules/OnlineMarketing/Controls/UI/ABTest/ListWithValues.xml";

        lnkTestRate.NavigateUrl            = "#";
        lnkTestValue.NavigateUrl           = "#";
        lnkTestValue.Attributes["OnClick"] = "if (parent.parent.selectTreeNode != null) parent.parent.selectTreeNode('ABTest.ConversionsValue');parent.location=\"abtest_frameset.aspx?page=conversionsvalue&displayTab=abtesting.conversionsvalue\"";
        lnkTestRate.Attributes["OnClick"]  = "if (parent.parent.selectTreeNode != null) parent.parent.selectTreeNode('ABTest.ConversionsRate');parent.location=\"abtest_frameset.aspx?page=conversionsrate&displayTab=abtesting.conversionrate\"";

        ucABTests.AllowAll         = true;
        ucABTests.AllowEmpty       = false;
        ucABTests.IsLiveSite       = false;
        ucABTests.ReturnColumnName = "ABTestName";
        ucABTests.PostbackOnChange = true;
    }
Esempio n. 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckWebAnalyticsUI("MVT.Overview");
        String siteName = CMSContext.CurrentSiteName;

        CurrentMaster.PanelContent.CssClass = "";

        ucDisplayReport = LoadControl("~/CMSModules/Reporting/Controls/DisplayReport.ascx") as IDisplayReport;
        pnlOverview.Controls.Add((Control)ucDisplayReport);

        ucConversionRateReport = LoadControl("~/CMSModules/Reporting/Controls/DisplayReport.ascx") as IDisplayReport;
        pnlConversionRate.Controls.Add((Control)ucConversionRateReport);

        ucTestValuesReport = LoadControl("~/CMSModules/Reporting/Controls/DisplayReport.ascx") as IDisplayReport;
        pnlConversionValue.Controls.Add((Control)ucTestValuesReport);

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!MVTestInfoProvider.MVTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblMVTestingDisabled.Text = GetString("mvt.disabled");
        }

        listElem.DelayedReload      = true;
        listElem.Grid.GridName      = "~/CMSModules/OnlineMarketing/Controls/UI/MVTest/ListWithValues.xml";
        listElem.Grid.Columns       = "MVTestDisplayName,MVTestID,MVTestCulture,MVTestPage,MVTestOpenFrom,MVTestOpenTo,MVTestEnabled,MVTestConversions,MVTestSiteID,HitsValue";
        listElem.ApplyTimeCondition = false;

        lnkTestRate.NavigateUrl            = "#";
        lnkTestValue.NavigateUrl           = "#";
        lnkTestValue.Attributes["OnClick"] = "if (parent.parent.selectTreeNode != null) parent.parent.selectTreeNode('MVTestConversionValue');parent.location=\"frameset.aspx?page=mvtreport&displayTab=abtesting.conversionsvalue&reportCodeName=mvtestconversionvalue.yearreport;mvtestconversionvalue.monthreport;mvtestconversionvalue.weekreport;mvtestconversionvalue.dayreport;mvtestconversionvalue.hourreport\"";
        lnkTestRate.Attributes["OnClick"]  = "if (parent.parent.selectTreeNode != null) parent.parent.selectTreeNode('MVTestConversionRate');parent.location=\"frameset.aspx?page=mvtreport&displayTab=mvtest.conversionrate&reportCodeName=mvtestconversionrate.yearreport;mvtestconversionrate.monthreport;mvtestconversionrate.weekreport;mvtestconversionrate.dayreport;mvtestconversionrate.hourreport\"";


        ucMVTests.AllowAll         = true;
        ucMVTests.AllowEmpty       = false;
        ucMVTests.IsLiveSite       = false;
        ucMVTests.ReturnColumnName = "MVTestName";
        ucMVTests.PostbackOnChange = true;
    }
Esempio n. 20
0
    /// <summary>
    /// Logs web analytics data.
    /// </summary>
    private void LogWebAnalytics(UserInfo ui)
    {
        // Track successful registration conversion
        if (TrackConversionName != String.Empty)
        {
            if (AnalyticsHelper.AnalyticsEnabled(CurrentSiteName) && !AnalyticsHelper.IsIPExcluded(CurrentSiteName, RequestContext.UserHostAddress))
            {
                HitLogProvider.LogConversions(CurrentSiteName, LocalizationContext.PreferredCultureCode, TrackConversionName, 0, ConversionValue);
            }
        }

        // Log registered user if confirmation is not required
        if (!ConfirmationRequired)
        {
            AnalyticsHelper.LogRegisteredUser(CurrentSiteName, ui);
        }
    }
    /// <summary>
    /// OnAfterSave event handler
    /// </summary>
    protected void form_OnAfterSave(object sender, EventArgs e)
    {
        if (form.IsInsertMode)
        {
            if ((TrackConversionName != String.Empty))
            {
                string siteName = SiteContext.CurrentSiteName;

                if (AnalyticsHelper.AnalyticsEnabled(siteName) && Service.Resolve <IAnalyticsConsentProvider>().HasConsentForLogging() && !AnalyticsHelper.IsIPExcluded(siteName, RequestContext.UserHostAddress))
                {
                    HitLogProvider.LogConversions(SiteContext.CurrentSiteName, LocalizationContext.PreferredCultureCode, TrackConversionName, 0, ConversionValue);
                }
            }

            // Redirect to edit mode after new item submit
            URLHelper.Redirect(URLHelper.AddParameterToUrl(RequestContext.CurrentURL, ItemKeyName, form.ItemID.ToString()));
        }
    }
Esempio n. 22
0
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        CurrentUserInfo cui = CMSContext.CurrentUser;

        // Check UI Permissions
        if (!cui.IsAuthorizedPerUIElement("CMS.Content", "OnlineMarketing.MVTVariants"))
        {
            RedirectToCMSDeskUIElementAccessDenied("CMS.Content", "OnlineMarketing.MVTVariants");
        }

        if (!cui.IsAuthorizedPerResource("cms.mvtest", "Read"))
        {
            RedirectToAccessDenied(String.Format(GetString("general.permissionresource"), "Read", "MVT testing"));
        }

        if (DataHelper.GetNotEmpty(URLHelper.GetCurrentDomain(), "") != "")
        {
            LicenseHelper.CheckFeatureAndRedirect(URLHelper.GetCurrentDomain(), FeatureEnum.MVTesting);
        }

        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblWADisabled.Text  = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!MVTestInfoProvider.MVTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblMVTestingDisabled.Text = GetString("mvt.disabled");
        }

        // Set NodeID in order to check the access to the document
        listElem.NodeID = NodeID;

        // Get the PageTemplateID of the current node
        if (Node != null)
        {
            listElem.PageTemplateID = Node.DocumentPageTemplateID;
        }
    }
    /// <summary>
    /// Logs web analytics data.
    /// </summary>
    private void LogWebAnalytics(UserInfo ui)
    {
        // Track successful registration conversion
        if (TrackConversionName != String.Empty)
        {
            if (AnalyticsHelper.AnalyticsEnabled(CurrentSiteName) &&
                Service.Resolve <IAnalyticsConsentProvider>().HasConsentForLogging() &&
                !AnalyticsHelper.IsIPExcluded(CurrentSiteName, RequestContext.UserHostAddress) &&
                SystemContext.IsCMSRunningAsMainApplication)
            {
                HitLogProvider.LogConversions(CurrentSiteName, LocalizationContext.PreferredCultureCode, TrackConversionName, 0, ConversionValue);
            }
        }

        // Log registered user if confirmation is not required
        if (!ConfirmationRequired)
        {
            AnalyticsHelper.LogRegisteredUser(CurrentSiteName, ui);
        }
    }
Esempio n. 24
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        // Log hit only if we are on the live site and banner is not reused from previous request
        if ((currentViewMode == CMS.PortalEngine.ViewModeEnum.LiveSite) && (banner != null) && !bannerReused)
        {
            string currentSiteName = SiteContext.CurrentSiteName;

            if (AnalyticsHelper.AnalyticsEnabled(currentSiteName))
            {
                if (AnalyticsHelper.JavascriptLoggingEnabled(SiteContext.CurrentSiteName))
                {
                    WebAnalyticsServiceScriptsRenderer.RegisterLogBannerHitCall(Page, banner.BannerID);
                }
                else
                {
                    HitLogProvider.LogHit("bannerhit", currentSiteName, null, null, banner.BannerID);
                }
            }
        }
    }
Esempio n. 25
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        // Log hit only if we are on the live site and banner is not reused from previous request
        if ((currentViewMode == CMS.PortalEngine.ViewModeEnum.LiveSite) && (banner != null) && !bannerReused)
        {
            string currentSiteName = CMSContext.CurrentSiteName;

            if (AnalyticsHelper.AnalyticsEnabled(currentSiteName))
            {
                if (AnalyticsHelper.JavascriptLoggingEnabled(CMSContext.CurrentSiteName))
                {
                    ScriptHelper.RegisterWebServiceCallFunction(Page);
                    string script = "WebServiceCall('" + URLHelper.GetAbsoluteUrl("~/CMSPages/WebAnalyticsService.asmx") + "','LogBannerHit', '{\"bannerID\":\"" + banner.BannerID + "\"}')";
                    ScriptHelper.RegisterStartupScript(Page, typeof(string), "logSearch", script, true);
                }
                else
                {
                    HitLogProvider.LogHit("bannerhit", currentSiteName, null, null, banner.BannerID);
                }
            }
        }
    }
Esempio n. 26
0
    protected override void OnInit(EventArgs e)
    {
        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!ABTestInfoProvider.ABTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblABTestingDisabled.Text = GetString("abtesting.disabled");
        }

        // Get the ID from query string
        this.editElem.ABTestID = QueryHelper.GetInteger("abTestId", 0);

        base.OnInit(e);
    }
Esempio n. 27
0
        /// <summary>
        /// Loads number of visits in the last week.
        /// </summary>
        /// <param name="liveTileContext">Context of the live tile. Contains information about the user and the site the model is requested for</param>
        /// <exception cref="ArgumentNullException"><paramref name="liveTileContext"/> is null</exception>
        /// <returns>Live tile model</returns>
        public LiveTileModel GetModel(LiveTileContext liveTileContext)
        {
            if (liveTileContext == null)
            {
                throw new ArgumentNullException("liveTileContext");
            }

            return(CacheHelper.Cache(() =>
            {
                if (!AnalyticsHelper.AnalyticsEnabled(liveTileContext.SiteInfo.SiteName))
                {
                    return null;
                }

                var weekVisitsCount = GetWeekVisitsCount(liveTileContext.SiteInfo.SiteID);

                return new LiveTileModel
                {
                    Value = weekVisitsCount,
                    Description = ResHelper.GetString("webanalytics.livetiledescription")
                };
            }, new CacheSettings(2, "WebAnalyticsLiveTileModelProvider", liveTileContext.SiteInfo.SiteID)));
        }
Esempio n. 28
0
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }


        if (!ABTestInfoProvider.ABTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblABTestingDisabled.Text = GetString("abtesting.disabled");
        }

        ScriptHelper.RegisterProgress(Page);

        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "SaveDocument",
                                               ScriptHelper.GetScript("function SaveDocument(nodeId, createAnother) { " + ControlsHelper.GetPostBackEventReference(this, "#", false).Replace("'#'", "createAnother+''") + "}"));
    }
Esempio n. 29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Grid initialization
        gridElem.OnAction            += new OnActionEventHandler(gridElem_OnAction);
        gridElem.OnExternalDataBound += new OnExternalDataBoundEventHandler(gridElem_OnExternalDataBound);

        // Add site dependecy to where condition
        gridElem.WhereCondition = SqlHelperClass.AddWhereCondition(gridElem.WhereCondition, "ABTestSiteID=" + CMSContext.CurrentSiteID);

        // Add alias path condition - used in document depending abtest
        if (AliasPath != String.Empty)
        {
            gridElem.WhereCondition = SqlHelperClass.AddWhereCondition(gridElem.WhereCondition, "ABTestOriginalPage=N'" + SqlHelperClass.GetSafeQueryString(AliasPath, false) + "'");
        }

        if (ShowFilter)
        {
            gridElem.GridName       = "~/CMSModules/OnlineMarketing/Controls/UI/AbTest/ListNoFilter.xml";
            gridElem.WhereCondition = SqlHelperClass.AddWhereCondition(gridElem.WhereCondition, ucFilter.WhereCondition);

            if (ucFilter.Parameters != null)
            {
                gridElem.QueryParameters = ucFilter.Parameters;
            }
        }
        else
        {
            pnlFiler.Visible = false;
        }

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(CMSContext.CurrentSiteName) ||
            !AnalyticsHelper.TrackConversionsEnabled(CMSContext.CurrentSiteName))
        {
            webAnalyticsEnabled = false;
        }
    }
Esempio n. 30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String siteName = CMSContext.CurrentSiteName;

        // Display disabled information
        if (!AnalyticsHelper.AnalyticsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblDisabled.Text    = GetString("WebAnalytics.Disabled") + "<br/>";
        }

        if (!ABTestInfoProvider.ABTestingEnabled(siteName))
        {
            this.pnlDisabled.Visible       = true;
            this.lblABTestingDisabled.Text = GetString("abtesting.disabled");
        }

        if (!AnalyticsHelper.TrackConversionsEnabled(siteName))
        {
            this.pnlDisabled.Visible = true;
            this.lblTrackConversionsDisabled.Text = GetString("webanalytics.tackconversionsdisabled");
        }

        // Prepare the actions
        string[,] actions = new string[1, 6];
        actions[0, 0]     = HeaderActions.TYPE_HYPERLINK;
        actions[0, 1]     = ResHelper.GetString("abtesting.abtest.new");
        actions[0, 3]     = ResolveUrl("new.aspx");
        actions[0, 5]     = GetImageUrl("Objects/OM_AbTest/add.png");

        // Set the actions
        ICMSMasterPage master = this.CurrentMaster;

        master.HeaderActions.Actions = actions;

        listElem.ShowFilter = true;
    }