Skip to content

Enhance Type 1 video analytics tracking #1870

@coderGtm

Description

@coderGtm

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

  1. Open a page with multiple videos and keep DevTools → Network open.
  2. Filter for analytics requests / page_load.
  3. 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.
  4. Scroll down until a below-the-fold video enters the viewport.
    • A type 1 request should fire for that video only.
  5. Scroll that same video out of view and back in.
    • It should not fire type 1 again.
  6. 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.
  7. Please also verify the request payload has the correct:
    • videoId
    • jobId

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions