Determining which page the customer is browsing

Professional Edition onlyBusiness Edition only Customer care also allows CSRs to determine what page the customers in the store are currently browsing. The starter stores determine what pages the customers are in, by including CustomerCareHeaderSetup.jsp file in the header file (HeaderDisplay.jsp). The following code in the CustomerCareHeaderSetup.jsp file obtains the page URL information and updates the shopper applet:

<script language="javascript">
var PageName="";
var PersonalPage=false;
<%
 String pname = request.getRequestURI();
 int indpn = pname.lastIndexOf('/');
 indpn = pname.lastIndexOf('/', indpn-1);
 
 if(indpn != -1)
         pname = pname.substring(indpn+1);

 String headerType = (String) request.getAttribute("liveHelpPageType");
 if (headerType==null) headerType="";
    
 // Determine if this is a personal page or not
 if (headerType.equals("personal"))
 {
  %>
    if (typeof parent.setPageParams == 'function') {
     PersonalPage=true;
       parent.setPageParams('PERSONAL_URL', '<%=pname%>');
       }
  <% 
 } 
 else 
 { 
  %>
    if (typeof parent.setPageParams == 'function')
      parent.setPageParams(location.href, '%=pname%>');
  <% 
 } 
 %>
 Pagename="<%=pname%>";
</script>

You should not allow CSR to see customer pages that contain personalized information, since the content viewed by CSR may not be the same as viewed by a customer. For example, a CSR might not have access to a campaign page, a page that includes a price determined by a contract, or a page that includes the user ID, for example, the address book page. These pages should be marked as personal to avoid misleading the CSR during a chat session.

In order to mark pages as personal, that is, not available to the CSR, the starter stores include the following code in the header page, just before the CustomerCareHeaderSetup.jsp file is included.

<flow:ifEnabled feature="customerCare">
<%
      request.setAttribute("liveHelpPageType", "personal");
%>
</flow:ifEnabled>

Note: Although a CSR cannot see the content of a page marked personal by using the View Customer Page button, the CSR can see the URL of that page.

Feedback