Page times data

706 views
Skip to first unread message

Luu Arroyo

unread,
Jul 13, 2020, 7:07:25 PM7/13/20
to oTree help & discussion
Hi!
Are the times spent on each page recorded automatically or how can I record them?

I found this, but am not sure if it's updated.


I downloaded the file in the data section of otree but it looks weird (for example, there's only 3 rows, and there should be 10). Could it be that I stop the server and restarted it before downloading the file?

Thanks a lot!!

Luu Arroyo

unread,
Jul 13, 2020, 7:24:13 PM7/13/20
to oTree help & discussion
ps: What is page_index and epoch_time?

Luu Arroyo

unread,
Jul 13, 2020, 7:27:00 PM7/13/20
to oTree help & discussion
I figured out page_index

Chris @ oTree

unread,
Jul 14, 2020, 4:20:03 AM7/14/20
to oTree help & discussion
There is info here and a script you can download: https://otree.readthedocs.io/en/latest/admin.html#export-data

Luu Arroyo

unread,
Jul 14, 2020, 3:21:00 PM7/14/20
to oTree help & discussion
Thank you!
How much time should I wait to be sure I get the complete data of PageTimes?
I get the first participant complete and then just part of the second.
I have to wait a few minutes, without restarting the server? Is that the only way?

Chris @ oTree

unread,
Jul 14, 2020, 3:39:40 PM7/14/20
to oTree help & discussion
If your data is not all appearing immediately, wait a couple minutes then create a demo session and play through a few pages. This is because the data gets written out in batches, not on every single page submission.

Luu Arroyo

unread,
Jul 14, 2020, 7:35:03 PM7/14/20
to oTree help & discussion
thanks!

ctttdaisy

unread,
May 10, 2021, 1:01:18 PM5/10/21
to oTree help & discussion
Hi all,

May I ask a follow-up question on this thread: Chirs, you mentioned the script at  https://otree.readthedocs.io/en/latest/admin.html#export-data
Could you please give a brief instruction how I could run this script? Should it be put in the settings.py?

Many thanks,
Daisy

Chris @ oTree

unread,
May 10, 2021, 8:47:49 PM5/10/21
to ctttdaisy, oTree help & discussion
The instructions are inside that file. 

Sent from my phone

On May 11, 2021, at 1:01 AM, ctttdaisy <trieutha...@gmail.com> wrote:

Hi all,
--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/ccc2a539-83e0-46e3-b374-414215b5926fn%40googlegroups.com.

DallasN

unread,
Oct 26, 2021, 6:09:54 PM10/26/21
to oTree help & discussion
Hi Daisy,

For the command python pagetimes.py infile.csv outfile.cs,

You run in the terminal.

All you need to do is:

1) Download the pagetimes.py file to your project directory

2) Download the "infile" .csv file from oTree's "data' tab (at the bottom of the screen) to an appropriate location

3) run the command in your terminal

As best practice, I wouldn't download the file to your project directory, in case it's a public repository. For instance, I might do the following:

python pagetimes.py C:\Users\dalla\Desktop\infile.csv C:\Users\dalla\Desktop\outfile.csv

LS

unread,
Jan 14, 2022, 5:06:44 AM1/14/22
to oTree help & discussion
Hi Chris,

I am wondering why the seconds_on_page is not in the dataset by default (I think it was in earlier versions of otree?!).
If storing just the time stamp is less demanding for the server, isn't it possible to run the script automatically when downloading the data from the server?

Best,
Louis

Chris @ oTree

unread,
Jan 14, 2022, 5:15:56 AM1/14/22
to oTree help & discussion
I did consider doing that, but in this case I prefer to keep the complexity out of otree-core. Plus, people might want to modify the script for their own needs, i.e. to measure/aggregate time differently. Providing it as a script means people can easily see how it works and modify it.

Chris @ oTree

unread,
Jan 14, 2022, 5:22:47 AM1/14/22
to oTree help & discussion
Another thing that may have factored into this decision (if I recall correctly) is that i wanted it to be transparent. Because there are different ways of defining "time on a page" and I remember some people misinterpreting that, so providing the source allows people to inspect how it is calculating it.

LS

unread,
Jan 14, 2022, 5:24:30 AM1/14/22
to oTree help & discussion
Thanks for the quick feedback, Chris!

K E

unread,
Apr 3, 2022, 7:44:20 PM4/3/22
to oTree help & discussion
It seems like the page time data is no longer available. Could someone direct me of how to perform these same saves with the newest updates? It seems to only offer me the option of "Plain" or "Excel" output data and the pagetimes command is not working based on these outputs.

Chris @ oTree

unread,
Apr 4, 2022, 12:48:46 AM4/4/22
to K E, oTree help & discussion
It’s still there. Click “Data” in the black header bar. 

Sent from my phone

On Apr 4, 2022, at 7:44 AM, K E <maddes...@gmail.com> wrote:

It seems like the page time data is no longer available. Could someone direct me of how to perform these same saves with the newest updates? It seems to only offer me the option of "Plain" or "Excel" output data and the pagetimes command is not working based on these outputs.
--
You received this message because you are subscribed to a topic in the Google Groups "oTree help & discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/otree/NHBISjrnlxo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/ccdb3ed3-ede9-4d84-a7ef-d42c8870f339n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages