Skip to main content
1-Visitor
November 16, 2020
Question

Make widget appear once tracking acquired

  • November 16, 2020
  • 1 reply
  • 1028 views

I'm trying to make widgets appear once initial tracking is acquired.

I tried using the below code but it doesn't seem to work.

$scope.$on('tracking', function()
 {
 $scope.view.wdg['label-2']['visible'] = true;
})

 What service do I need to use to make it work?

1 reply

21-Topaz I
November 17, 2020

I would suggest to use some thing like this:

 

 

$scope.$on('tracking', function() 
{ //$scope.view.wdg['label-2']['visible'] = true; 
$scope.setWidgetProp('label-2','visible',true);
$scope.$applyAsync();
})

 

another poinit is to check if the tracking event fired  e.g. via snackbar message on mobile device: 

 


$scope.$on('tracking', function() 
{ 
$timeout(twx.app.fn.addSnackbarMessage("tracking Event fired","twLogo"),200);
$scope.setWidgetProp('label-2','visible',true);
$scope.$applyAsync();
})