Logging page views

krishnagopal_sn
Tera Contributor

Hey team, I'm facing an issue regarding logging page views in the sp_log table when a user clicks on a link. Presently, it's only registering when the user directly clicks on it. If the user hovers over and selects "open in new tab," or uses the mouse wheel to open it, the action isn't being recorded in the sp_log table 

 

HTML      

<div class="mu-gbl-resources-item" ng-repeat="subtopics in data.childTopics" ng-click="c.captureClickCount(subtopics)">
        <a ng-if="subtopics.name =='Policies'" ng-click="loadKBPolicies()">          
            {{subtopics.name}}           
        </a>

</div>

Client

  c.captureClickCount = function(item) {
    c.data.contentItemID = item.id;
    c.data.contentName = item.name;
    c.data.action = "addClickCount";
    c.server.update().then(function(){
          c.data.action = undefined;
          c.data.message = "";
      })
  }

 

Server 

if (input && input.action == "addClickCount") 
  {
    data.messages = input.messages;
    $sp.logStat('Quick Link View','sn_ex_sp_quick_link',input.contentItemID,input.contentName,$sp.getPortalRecord().getUniqueValue());
  }

0 REPLIES 0