log time to play #1853
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#1853
Loading…
Reference in a new issue
No description provided.
Delete branch "log-time-to-play"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Notes
This ended up being a little more complex after realizing we need to reset analytics data when users navigate directly to another file (where the File page won't be re-mounted)
There are three scenarios:
file_view
with notime_to_start
file_view
withtime_to_start
Currently outpoint is still not included in the claim information (https://github.com/lbryio/lbry/issues/1306). Previously, we were calling
Lbry.get
which returns theoutpoint
and we used that for this api call.We can't read it from
fileInfo
because that will not exist if we try to fire the analytics event in response to a user navigating away before the file is downloaded.I think the simplest approach would be to wait for https://github.com/lbryio/lbry/issues/1306 and grab
outpoint
along with the rest of the data from the claim information.@skhameneh @kauffj Thoughts?
Three comments:
I think this overlaps some with @daovist work on media history. Please discuss on stand-up if it makes sense to combine this work or for media history to contain this value.
View tracking may currently supports parameters other than outpoints.
Please don't hesitate to point this issue out to a daemon team member and/or comment on that ticket itself. I suspect this is a fairly small one to fix.
A claim's outpoint is just:
${claim.txid}:${claim.nout}
. I don't understand why #1306 is an issue.@daovist Nice. I knew outpoint was some sort of combination of stuff but didn't realize we had all of it already inside of
claim
. I think that issue is still valid. For other devs, if they see that code snippet they might not know it is an outpoint.@ -251,0 +258,4 @@
}
};
}
Lint was telling me to move this up
@ -165,3 +238,3 @@
<Player
fileName={fileInfo.file_name}
filename={fileInfo.file_name}
poster={poster}
Why would we log the same parameters with every analytics event?
There doesn’t appear to be any event name associated as well, this could make things difficult to differentiate events.
@ -165,3 +238,3 @@
<Player
fileName={fileInfo.file_name}
filename={fileInfo.file_name}
poster={poster}
Not sure what you mean. We log the same parameters, but only once per file. The actual api call is here https://github.com/lbryio/lbry-desktop/blob/master/src/renderer/analytics.js#L47
@ -165,3 +238,3 @@
<Player
fileName={fileInfo.file_name}
filename={fileInfo.file_name}
poster={poster}
With this change, we'll be calling the file_view api if a user simply starts a download, but then leaves the page? Am I understanding that correctly? This would not happen before, and I'm not sure we want it to count as an actual file view (for rewards purposes at least). Previously, you could go into a claim, let it start playing, leave and it would only count a file_view if it started downloading (which counted a file_view correctly). Now it seems like we either count all attempts, or we only count those attempts where they stayed on the page and it started streaming.
@ -165,3 +238,3 @@
<Player
fileName={fileInfo.file_name}
filename={fileInfo.file_name}
poster={poster}
Whoops. You are right @tzarebczan
I need to make sure it doesn't fire if the video hasn't started downloading. Will be easy to add.
@tzarebczan Just updated this to only fire if a user leaves the page after it has started downloading. Before it was firing if they clicked play and left even if it wasn't downloading.
@skhameneh Did you have any concerns before merging?
@seanyesmunt
My concern is that we want this information!
@kauffj Ok makes sense. I will revert the last commit.
@kauffj Tom had a comment
my only concern is that it's now even easier to get a "view" - the file doesn't even have to start playing. Maybe we need to only take into account files with time to play for rewards purposes?
If we change the behavior by adding a view event, we may need to change rewards logic.
@seanyesmunt this is why I had mentioned tagging different events explicitly, isn’t the immediate approach to move forward and change how we track analytics to be more explicit?
We need an approach where we capture a lot of raw data and do transforms to SQL for more specific tables that correlate to data captured.
@seanyesmunt the rewards logic would ideally be a separate issue
We can worry about the rewards logic on the internal-api side. I think this is ready to be merged in right?