Skip to main content

Sitecore Analytics Database Manager (ADM) Module Customization

Sitecore Analytics Database Manager (ADM) Module Customization

Sitecore Analytics Database Manager (ADM) Module Customization


Recently I got the situation where I want to remove multiple contacts from xDB. I do not want to write my custom code.

Then I found Analytics Database Manager (ADM) 4.0.1 module in Marketplace, but it was not fulfilling my requirement because this module has only below options:
  • Remove Historical Data:  Removing all contacts and all related data without interactions after the specific date
  • Rebuild Calculated Facet: Historcial rebuild of calculated facets
  • Remove Single Contact Data: Removing single contact by ID or identifier

Sitecore Analytics Database Manager (ADM) Module Customization


To fulfill my requirement, instead of creating a new tab for multiple contact removal, I did some minor change in Remove Single Contact Data. 
  • Open “AdmTaskPage.js” from this location “sitecore\shell\client\Your Apps\ADM\AdmTaskPage“
  • Replace “removeContact” function from below code, to remove multiple contacts from xDB
  •  removeContactByID: function (id) {  
                    jQuery.ajax({  
               type: "POST",  
               url: "/sitecore/adm/client/StartContactDataRemovingById?contactId=" + id,  
               success: function (result) {  
                 app.MessageBar2.addMessage("warning", result.replace(/^"(.+(?="$))"$/, '$1'));  
               },  
               error: function (xhr, error, thrownError) {  
                 app.MessageBar1.addMessage("error", "The error occured with the following message '" + thrownError + "' Please check logs for details");  
                 err = "yes";  
               }  
             });  
               },  
         removeContact: function () {  
           app.MessageBar2.removeMessages();  
           app.MessageBar2.set("expanded", "true");  
           app.ContactExpander.viewModel.show();  
           var running = app.checkIsRunning();  
           var enc = running.toString().replace(/[^a-zA-Z]+/g, '');  
           if (enc != "NotRunning") {  
             app.MessageBar2.addMessage("warning", "The remove task can't be started while another one is running.");  
             app.trigger("disable:ContactStatus");  
             return;  
           }  
           var err = "no";  
           if (app.IdentCheckBox.get("isChecked")) {  
                          app.MessageBar2.addMessage("warning", "Contact removing has been requested.");  
                         var ids=app.IdTextBox.get("text");  
                         var list=ids.split('|');  
                         for(var i=0;i<list.length;i++){  
                              app.removeContactByID(list[i]);  
                         }  
           } else {  
             app.MessageBar2.addMessage("warning", "Contact removing has been requested.");  
             jQuery.ajax({  
               type: "POST",  
               contentType: 'application/json',  
               data: JSON.stringify({  
                 "source": app.SourceTextBox.get("text"),  
                 "identifier": app.IdentTextBox.get("text")  
               }),  
               url: "/sitecore/adm/client/StartContactDataRemoving",  
               success: function (result) {  
                 app.MessageBar2.addMessage("warning", result.replace(/^"(.+(?="$))"$/, '$1'));  
                 if (result.indexOf("was not found") !== -1) {  
                   app.trigger("disable:ContactStatus");  
                   app.trigger("enable:RemoveContact");  
                   err = "yes";  
                 }  
               },  
               error: function (xhr, error, thrownError) {  
                 app.MessageBar1.addMessage("error", "The error occured with the following message '" + thrownError + "' Please check logs for details");  
                 err = "yes";  
               }  
             });  
           }  
           if (err == "yes") {  
             return;  
           }  
           app.trigger("disable:RemoveContact");  
           app.trigger("enable:ContactStatus");  
         },  
    
  • Move into this function “removeDataDialogue” and comment below lines:
  •  var valid = app.validateGuid(id);  
               if (!valid) {  
                  app.Label1.set("text", "entered contact ID is not a valid GUID");  
                 return;  
               }  
    
  • Switch into Core DB and go to this location “/sitecore/client/Your Apps/ADM/AdmTaskPage/PageSettings/Tabs/Remove  Single Contact Data”
  • Click on Presentation->Details and select “TextBox” rendering
Sitecore Analytics Database Manager (ADM) Module Customization
  • Do blank in “MaxLength: field
Sitecore Analytics Database Manager (ADM) Module Customization
  • Now I can add multiple contacts with pipeline separated like “F9F1F37A-6BCA-0000-0000-05AA3D2C0176|F9F1F37A-6BCA-0000-0000-05AA3D26BAF1|F9F1F37A-6BCA-0000-0000-05AA3D219161”
Sitecore Analytics Database Manager (ADM) Module Customization
  • Click “Yes” button, it will remove multiple contacts








Comments

Popular posts from this blog

Sitecore Certification Sample Questions

Sitecore Certification Sample Questions I have completed the Sitecore 9 certification in 2019 and Sitecore 8.2 Certification in 2018. Let me tell you if you have some knowledge about Sitecore then it will be easier for you to understand questions and clear certification exam. Your main focus should be to understand the questions and answers carefully because it is too confusing There will be two options to give the exam: Install the software in your laptop (Laptop should have mic and webcam) Authorized training Center If you have proper Internet, then you can choose option 1 otherwise option 2 is a good choice. Disclaimer : Please note that the below question is only for information purpose only. Below question does not claim the accuracy of the content. Sample Questions: Question 1: What is the name of Component architecture guideline of Sitecore? Answer : Helix Question 2 : What is horizontal scaling and vertical scaling? Answer :  https://doc.

Sitecore 9 Forms: Google reCaptcha field

Sitecore 9 Forms: Google reCaptcha field  Re-Captcha is the most important part of any form’s submission. Google reCaptcha run internet bot detector and determined whether a user is a bot or not.  Sitecore Forms does not provide Google reCaptcha field, which was available in WFFM before, so I have created my custom Google reCaptcha.   Below you can find step by step process to create Google reCaptcha field. Create patch config for reCaptcha Sitekey and SecretKey <?xml version="1.0"?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/"> <sitecore> <settings> <setting name="ReCaptchaSiteKey" value="site-key" /> <setting name="ReCaptchaSecretKey" value="secret-key" /> </settings> </sitecore> </configuration> Create new viewmodel class RecaptchaViewMode

Create Sitecore Custom Admin Page

Create Sitecore Custom Admin Page Sitecore provides you lots of Admin pages just like ShowConfig.aspx, cache.aspx, Logs.aspx, howServicesConfig.aspx, etc. which you can check from here http://<yoursite>/sitecore/admin/. All Sitecore Admin pages is available in this folder “sitecore/admin/*” Sometimes there can be requirement that you want to create custom Admin page which will be accessible to Admin/Non-Admin user. Here is an example: Create aspx page “CustomAdminPage.aspx” inside “<root>/sitecore/admin” folder <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomAdminPage.aspx.cs" Inherits="Namespace.CustomAdminPage" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Custom Admin Page</title> <link rel="stylesheet" type="text/css" href="/sitecore/she