Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

getPercentPageViewed v3.0 plug in question

Avatar

Community Advisor

Hello Team,

I am using the new plugin getPercentPageViewed v3.0 with getPreviousValue​ but somehow its not working correctly.

I have implemented like below

Added both the plugin code in PLUGIN Section, and doPlugin section added below code.

s.prop9 = s.getPreviousValue(s.pageName, 's_ppn', '');

if (s.pageName !== undefined) {

var ppv = s.getPercentPageViewed(s.pageName); // passing the page name as parameter

if (ppv) {

s.prop9 = ppv[0]; // contains the previous page name

s.prop55 = ppv[1]; // contains the total percent viewed

s.prop56 = ppv[2]; // contains the percent viewed on initial load

s.prop54 = ppv[3]; // contains the total number of vertical pixels

}

}

getting the result as undefined. s.getPercentPageViewed(s.pageName) is not executing. Even though I tried to debug the plugin code, it says pid is not defined.

Please check attached screenshot

1671131_pastedImage_10.png

Can someone please help ?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi Gokul,

In  s.getPercentPageViewed(s.pageName) function call don't pass s.pageName as parameter since it default to Analytics Pagename variable.

Thanks,

Charles

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

Hi Gokul,

In  s.getPercentPageViewed(s.pageName) function call don't pass s.pageName as parameter since it default to Analytics Pagename variable.

Thanks,

Charles