Skip to main content
MindTouch Success Center

Gain insight into customer activity

This article explains how to integrate a user-friendly customer insights tool into your existing SAP CRM. With the customer insights tool, your agents can instantly see a full history of customer view and search activity across every channel. 


The primary benefits for the organization are:

  • Better context: Agents can see exactly what the customer was trying to accomplish before filing the case.
  • Avoid resending content: To avoid customer frustration, agents can ensure customers haven't yet seen the articles that will be sent. (Or, if the correct article has been seen, agents can verify if all steps were performed correctly.)
  • Identify gaps in self-service: Agents can notice whether relevant results were clicked after searching, and suggest new search recommendations that should appear.
  • Lowers costs: Agents improve their Mean Time To Resolution by quickly identifying what the customer is trying to accomplish.


After completing this how-to you will have a customer insights  interface similar to the following, running inside your existing application.:

The sample code brings the power of the customer insights tool into your CRM. The key features for agents include:

  • Instant access to customer history, which is loaded when the case is opened
  • Quick access to the exact searches and pages performed by clicking the link
  • Detailed information about the exact date (and time) a customer performed the request


In order to set up this integration, you should have:

  • A CRM that can run HTML code
  • Basic familiarity with Javascript
  • Basic familiarity with CSS (if styling customization is desired)

Step 1: Download the sample code

Download the sample file to your computer.

Step 2: Set configuration variables

The sample code is configured to use the MindTouch Success Center at In the top of the file, modify the following settings:

var MindTouch = {};
MindTouch.SITE_URL = "";
MindTouch.CUSTOMER_ID = '';
  • SITE_URL - the MindTouch site to connect to (connect to the HTTPS version of the site, since most CRM systems are HTTPS themselves)
  • CUSTOMER_ID - the username (or anonymous session ID) of the customer. The customer username is a more reliable way to track activity between sessions.

Step 3: Enable customer history tracking

Ensure you are logged-in with a pro member with the USERHISTORY permission enabled for the site. This can be enabled via the API or you can contact MindTouch support to configure a specific pro member role with USERHISTORY enabled. You can then add users with that role to a group. When enabled, verify that you can visit the User Activity Report and lookup the history for a customer.

Next, ensure the CUSTOMER_ID is available in your case management system. Although MindTouch provides anonymous session IDs as part of the integration workflow, it's best to provide the username of the customer. (Using SSO, your customers can automatically log into MindTouch).

Using the customer username provides better tracking and avoids the risk of losing information if the customer changes browsers or clears browser cookies, which would clear the anonymous session. Learn more about the customer activity API

Step 4: Integrate the code with your CRM software

The last step is to integrate the code into your CRM. Using the HTML widget functionality, copy the widget HTML code into the appropriate location. A few caveats:

  • Single Sign-On (SSO): The search widget uses the API and no SSO is performed. If the user has an existing session with MindTouch, it will be re-used by these API requests.
  • jQuery: The widget code uses a version of jQuery hosted by Google, and is stored as $j in noConflict mode. If the CRM has an existing jQuery library, this can be used instead.
        <!-- PREREQUISITE: jQuery -->
        <script src=""></script>
  • API Requests: The widget makes direct API calls using jQuery's $.ajax() function. If the CRM provides its own AJAX library, this can be used instead.
    var url = MindTouch.SITE_URL + '/@api/deki/events/support-agent/=' + customerId + '?dream.out.format=jsonp&dream.out.pre=?';
    var params = {
       limit: 50,
       include: "page,file",
       origin: MindTouch.WIDGET_NAME
  • Custom Behavior: The code was written to be modular. The rendering of the activity interface can be easily modified to support a different look and feel.
  • Accessing the Customer ID: When SSO is setup, the customer username is often the customer's email address. If a different system is in place, ensure the CRM has this as a variable that can be passed to the Insights widget.
  • Custom Styling: The CSS at the bottom of the widget can be modified to restyle the widget. This code sample references the Font Awesome icon font for the page and search icons. 
  • Was this article helpful?