Expand my Community achievements bar.

getPercentPageViewed not working properly with AJAX requests


Level 1


We are trying to use getPercentPageViewed function in our dtm implementation. The function works properly on every page except pages that dynamically change (like JSP). We also want to keep track of those pages which are updated dynamically with AJAX request. Since AJAX request updates the page without reloading the page getPercentPageViewed function cannot understand that the page has changed. Therefore, at the end of the function, it seems that returning value from this function is different than expected.

We've examined the function and written a Javascript code on JSP side (without changing the actual function getPercentPageViewed) to fix this issue. When JSP has been loaded this Javascript code runs and makes some changes. Consequently the problem has been solved.

But nevertheless we wanted to ask, is there any solution that you can give so that we can fix this issue?

0 Replies