Thanks for the reply. Given the output I got when I tried different timespans, I had a feeling this was not the case.
After trying your suggestion, I can tell you that the results are either,
1. The same (when I tried ts='86400')
OR
2. Only slightly different (a difference of one 20 minute time interval when I tried a different ts)
I'm not sure what has changed, but when I previously ran the function at ts='86400' I received 8 hours of data, but when I tried this time I only received 2 hours and 20 minutes of non-continuous data over a period of a day. This is unrelated from your suggestion as I get the same data with or without total_pages.
Does anyone also know why I would suddenly get less and non-continuous data for the same client ID and same ts?