This issue tracks refactoring and improvement of the video analytics tracking logic in assets/src/js/godam-player/analytics.js. The main focus is to ensure that "page_load" (type 1) analytics events are sent exactly once per video instance, triggered when the video enters the viewport, and to deduplicate these events across different code paths. The code now uses IntersectionObserver for more accurate event timing and centralizes the logic for identifying video instances.
Related PR: #1864
What changed
type 1 is no longer sent as one bulk request on page load for all videos.
- It should now fire per video instance, only the first time that instance enters the viewport.
How to test
- Open a page with multiple videos and keep DevTools → Network open.
- Filter for analytics requests /
page_load.
- Refresh the page.
- Videos already visible in the viewport may send
type 1.
- Videos below the fold should not send yet.
- There should not be one bulk request containing all videos.
- Scroll down until a below-the-fold video enters the viewport.
- A
type 1 request should fire for that video only.
- Scroll that same video out of view and back in.
- It should not fire
type 1 again.
- If the same underlying video appears multiple times on the page:
- each rendered instance should fire its own
type 1 when it first enters the viewport.
- Please also verify the request payload has the correct:
Expected result
- one
type 1 per video instance
- only on first viewport entry
- no repeat on re-entry
- no bulk “all videos on page load” request
Please also flag if:
- all videos fire immediately on load
jobId is empty unexpectedly
- the same instance fires more than once
- heatmap / other video analytics look impacted
These changes are related to GoDAM video player. The event should be sent regardless of autoplay behavior.
For grid of videos, the calls should be sent for each video once.
This issue tracks refactoring and improvement of the video analytics tracking logic in assets/src/js/godam-player/analytics.js. The main focus is to ensure that "page_load" (type 1) analytics events are sent exactly once per video instance, triggered when the video enters the viewport, and to deduplicate these events across different code paths. The code now uses IntersectionObserver for more accurate event timing and centralizes the logic for identifying video instances.
Related PR: #1864
What changed
type 1is no longer sent as one bulk request on page load for all videos.How to test
page_load.type 1.type 1request should fire for that video only.type 1again.type 1when it first enters the viewport.videoIdjobIdExpected result
type 1per video instancePlease also flag if:
jobIdis empty unexpectedlyThese changes are related to GoDAM video player. The event should be sent regardless of autoplay behavior.
For grid of videos, the calls should be sent for each video once.