box-python-sdk icon indicating copy to clipboard operation
box-python-sdk copied to clipboard

Access Statistics on Files for share links

Open c-rei opened this issue 4 years ago • 4 comments

I known I can get a preview count and download count with below codes. I downloaded this file with share link just one time, but I got 3 counts for download_count. So I think a download count includes a preview count, is't right?

Thanks any help.

file_id = '123456' shared_link = client.file(file_id).get().shared_link shared_link['preview_count'] 2 shared_link['download_count'] 3

Versions Used Python SDK: 2.12.1 Python: 3.8.10

c-rei avatar Nov 23 '21 23:11 c-rei

Hi @c-rei

Thanks for reaching out to us! The download_count shouldn't include the preview_count. It should only increment when file is downloaded. From my tests, it behaves this way. Are you sure you only downloaded this file once? Did you download the file from the browser or from the SDK?

Thanks, Mateusz

mwwoda avatar Nov 24 '21 10:11 mwwoda

Hi @Mateusz

Thanks for your response. For confirmation, I've got the access statistics with Box Report, that looks attached image. So there are one download and two previews from anonymous user with shared link. That's all.

I should explain some Japanese like below: 日付=date, ユーザー名=User Name, ユーザーメール=User mail, 操作=Action, 対象=Target, 詳細=Details 匿名=Anonymous, 以前のコラボレータ=Previous collaborator, プレビュー=Preview, ダウンロード=Download

log

Thanks, c-rei

c-rei avatar Nov 25 '21 00:11 c-rei

And I found that if I use a word file for shared link, I can get correct preview and download count each, but if I use a pdf file or a Excel file, I got a download count that includes a preview count.

Thanks, c-rei

c-rei avatar Nov 25 '21 05:11 c-rei

Yes, I can indeed see this happening with a .pdf and .xlsx files. For some unknown reason the download count is incremented when the link is accessed. It seems to be a problem with the API itself. From the SDK side, we only return the API response in this case. I will contact the team responsible for SharedLinks internally to see if they are aware of this issue. If you further help with this issue you can try contacting support via https://support.box.com/hc/en-us/requests/new.

Thanks, Mateusz

mwwoda avatar Nov 29 '21 11:11 mwwoda

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

stale[bot] avatar Dec 19 '22 20:12 stale[bot]

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Python SDK and feel free to open another PR/issue at any time.

stale[bot] avatar Dec 27 '22 06:12 stale[bot]