cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

$viewContentLoaded not getting called in Vuphoria Studio

SS_11298241
6-Contributor

$viewContentLoaded not getting called in Vuphoria Studio

I want to call a function sessionTracking as below on $viewContentLoaded and get the cookie values,but my function is not getting called on $viewContentLoaded and the console statements are not getting executed, Can you please let me know how can this be achieved using Vuphoria Studio?Is there $viewContentLoaded  in Vuphoria Studio If not what is the alternate way to do it? Please suggest.

 

$scope.getCookie = function(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for(let i = 0; i <ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}

$scope.sessionTracking = function(){
let xsrfToken = $scope.getCookie('XSRF-TOKEN');
console.log("xsrfToken"+xsrfToken);
let studioSessionId = $scope.getCookie('studio-sessionid');
console.log("studioSessionId"+studioSessionId);
let studioES = $scope.getCookie('studio_ES');
console.log("studioES"+studioES);
twx.app.fn.triggerDataService('ARSession.ARSessionTracking', {
xsrfToken,studioSessionId,studioES
})
}

 

 

 

0 REPLIES 0
Announcements


Top Tags