Logging page views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 03:21 AM - edited 04-18-2024 03:22 AM
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());
}