Any one have the page Scroll Depth Tracking events in current page itself | Community
Skip to main content
ranjithd
Level 4
October 7, 2022
Solved

Any one have the page Scroll Depth Tracking events in current page itself

  • October 7, 2022
  • 1 reply
  • 2336 views

Yes, we know the current page Scroll Depth Tracking is present default while we using plugins, but these values are captured on the next page only. But We are required to implement Scroll Depth Tracking for the current page, if the customer is reached a particular percentage then we need to fire the events and need to capture the element values in eVar. We have single-page applications & more dependency on other teams. 

 

 

Best answer by Sathya_Murugaiyan

In Adobe, there is no option to capture the value of the current page scroll depth. However, we can create custom JavaScript code to capture the value for the current page scroll depth.

1 reply

Sathya_Murugaiyan
Sathya_MurugaiyanAccepted solution
Level 2
October 7, 2022

In Adobe, there is no option to capture the value of the current page scroll depth. However, we can create custom JavaScript code to capture the value for the current page scroll depth.

ranjithd
ranjithdAuthor
Level 4
October 7, 2022

Yes, now we have developed a custom script to store the current page scroll tracking values. In case if required the scripts, mail us to share the guide.
We have used below the steps to archive the results.
$(window).on("scroll", function(){
var winheight = $(window).height();
var docheight = $(document).height();
var scrollTop = $(window).scrollTop();
------ // Manual codes
});

$(window).on('beforeunload', function (){
if(ScrollVal <= 25){
//Conditions 1
}else if(ScrollVal > 26 && finalScrollVal <= 50){
//Conditions 2
}else if(ScrollVal > 51 && finalScrollVal <= 75){
//Conditions 3
}else if(ScrollVal > 76){
//Conditions 4
}
return;
});

January 15, 2024

Hi, Where do we have to paste the Code, Can We use to Capture 10%, 20%..also?