Analytics and recorded events problem

Hi Doug,

I am continuing to prepare some logic on how to understand recorded video events to correctly calculate the time a user spent on a video viewing. It means in both variants, either using a separate browser tab (always with a new session identification) or as a modal dialog inside the same browser tab (with a different private token, but with the exact session identification and when “endedAt” property is updated even after many hours of break between two separate viewings, using two different private tokens).

The problem is that when opening a video, starting its viewing, and closing the browser tab, all during the first 10 seconds, the properties loadedAt and endedAt on the AnalyticVideo level have the same value. (I don’t know the exact time limit, it seems to be more than 10 secs but less than 20 secs.)

loadedAt: 2021-02-07T18:05:12.000Z
endedAt: 2021-02-07T18:05:12.000Z

Details on the video session events look like the following example. You can see that there is only the event type ready. The problem resume is that it’s impossible the determine how long the video was played or even if it was starting that play at all.

AnalyticSessionEvent {
  session: AnalyticSession {
    sessionId: 'ps65u0rQwccDnQ08wCcaLG5W',
    loadedAt: null,
    endedAt: null
  },
  resource: AnalyticResource { type: null, id: null },
  events: [
    AnalyticEvent {
      type: 'ready',
      emittedAt: 2021-02-07T18:05:12.000Z,
      at: 0,
      from: null,
      to: null
    }
  ]
}

When the browser tab is closed is a bit later (or minutes/hours later), you can see that there is a difference between loadedAt and endedAt. It looks like that the difference is approximately equal to the time the video was viewed.

loadedAt: 2021-02-07T23:35:45.000Z
endedAt: 2021-02-07T23:36:46.000Z

Details on the video session events look like the following example. You can see that there is the event type ready and play, but the time difference between them is tiny. The problem resume is that it’s impossible to determine how long the video was played, even if it was many minutes. It’s a bit of mystery what was the moment that was used to update the property “endedAt” to the value of 2021-02-07T23:36:46.000Z when there is no corresponding event for it.

AnalyticSessionEvent {
  session: AnalyticSession {
    sessionId: 'ps7DOzsitdNBKsUgoE5jh4Pw',
    loadedAt: null,
    endedAt: null
  },
  resource: AnalyticResource { type: null, id: null },
  events: [
    AnalyticEvent {
      type: 'ready',
      emittedAt: 2021-02-07T23:35:45.000Z,
      at: 0,
      from: null,
      to: null
    },
    AnalyticEvent {
      type: 'play',
      emittedAt: 2021-02-07T23:35:46.000Z,
      at: 0,
      from: null,
      to: null
    }
  ]
}

Both cases complicate the correct calculation of the elapsed viewing time.

Milos

Milos,

In your first session:

loadedAt: 2021-02-07T18:05:12.000Z
endedAt: 2021-02-07T18:05:12.000Z

It looks like there is just one event “ready.” but no playback… (I would expect a “Play” event when the video starts.)

in the second example:

loadedAt: 2021-02-07T23:35:45.000Z
endedAt: 2021-02-07T23:36:46.000Z

We have a ready, and a play… and then nothing more.
image

So what happened here. It looks like the video started - and then - at some point later (that we cannot determine), the tab closed.

Currently - ednded At is the last interaction with the player… in this case the 'play. After they hit play, there was no interaction with the player itself - so we cannot tell when the tab was closed. (we are working on a fix for this). IF the user had paused the video, and then closed the tab- you would have the start/stop time to do your measurement.

At this moment - you’d have to assume that no video was watched.

Doug

Hi Doug,

thanks for your answer. I understand that. From my point of view, there are two real problems to solve. It’s necessary to notice, that both cases are only 2 variations of the same user behavior: loading a video, click to play, and then a hard closing of a browser tab sometime later.

  1. In relation to my first example > the play event is really missing. I am not sure when exactly this event is emitted on a client-side and when it should be recorded, so where the problem is concentrating.

  2. In relation to my second example > there is certainly an interaction with the player, it’s the fetching of the next block of video data because this moment is already used for the update of endedAt (what else could be it), so it should be possible to transform that to an equivalent event. The only question is what event it should be, either end (a bit misleading, because it’s not the real end) or pause or a new one break (that would be probably an exact representation of a user hard tab close).

Milos

MIlos,

In example 1 - do you know that playing began? There is a possibility that the video was “ready” but never played (as the play event never fired). Perhaps the user pressed play, but the video never started before the browser closed? (this is admittedly a guess)

Example 2:

I agree, and I just spoke to the developer. We are going to add a “pause” event when the browser is closed to give an accurate timing on how much video has been watched. I will post when we’ve pushed this to production (should be this week).

Doug,

thanks for the good news related to #2.

Comments on #1:

Yes, I am 100% sure that the video started to play because I did all the tests. :wink: And now I have repeated it again with the same result.

You can check it with:

videoId: vinqz850D3ssS5RxSlNaFVJ
sessionId: ps1n7VSJtUZjmMCa4ljPVHn3

It’s the latest test on the sandbox.

Btw, is there any chance for an idea, that the API could be extended in some way to force a new session identity? I mean a solution for the case when using different private tokens inside the same browser tab.

Milos

Milos,

The fix for #2 is in production. When you close a tab, a “pause” event is recorded:

{
			"type": "pause",
			"emittedAt": "2021-02-10T11:15:43+00:00",
			"at": 10
		}
1 Like