Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

PageTime in loop

I need to test several video ads with additional questions in a loop, one loop iteration per ad and wanted to check if they were watched fully and if no than disqualify the respondent. I've tried to use  PageTime() in a skip logic, but it works only in the first loop iteration. It looks like the PageTime() returns the total time spent on the page in all iterations of the loop. How can I get the time spent on page in each iteration to use it in skip logic?

Using Lighthouse 9.8.1
related to an answer for: sys_pagetime
asked Apr 15, 2020 by Constantine Klim
edited Apr 15, 2020

1 Answer

0 votes
I believe this is not the correct approach as the respondent might have delayed clicking on play button or paused video in between. These cases will get skipped in page time method.

Instead, create a variable that sets value as 1 as soon as video playback completes and terminate if its value is 0.
answered Apr 15, 2020 by Saurabh Aggarwal Gold (34,700 points)
Saurabh Aggarwal, your proposal is good, and I have hide navigation buttons until the end of playback, but it doesn't cover cases when the video is rewinded to the end, so I wanted to compare the time spent on page with the list of ad durations and if the time spent on page is lower than the video duration than disqualify the person.
It may be possible to keep respondents from skipping around in the video.
 How are you embedding the videos?  YouTube?  Vimeo?
We use standard HTML player, ads are provided as files
With an HTML5 video, I think there are two main options.

The first option would be to hide all controls from the user by removing "controls" from the "<video>" element.  This will remove the ability to skip around, but also remove functionality like play/pause, volume control, etc.  You could consider the following possibilities:

* Adding "autoplay" the the "<video>" element will cause the video to begin playing automatically.

* Adding custom "<button>" elements to the page to provide respondents with another way to play, pause, mute, etc.

The second option would be to use the HTML5 video elements to effectively cancel attempts to skip in a video.  Looks like there is a "seeking" event we could use; we could probably hook up some code to that event to force the video to stay at its current timestamp when that event fires.