rambler-digital-solutions / video-ad-sdk

VAST/VPAID SDK that allows video ads to be played on top of any player
https://rambler-digital-solutions.github.io/video-ad-sdk/docs/
MIT License
7 stars 5 forks source link

Progress events aren't tracked because the URI is missing #18

Closed tomhooijenga closed 2 years ago

tomhooijenga commented 3 years ago

In handleMetric of class VastAdUnit the metric events are emitted:

  this.emit(event, {
    adUnit: this,
    type: event
  });

These events are then consumed in createVideoAdUnit:

Object.values(linearEvents).forEach((linearEvent) =>
    adUnit.on(linearEvent, (event) => {
      const {
        type: evtType,
        data
      } = event;
      const payload = {
        data,
        errorCode: adUnit.errorCode,
        tracker
      };

      trackLinearEvent(evtType, vastChain, payload);
    })
  );

createVideoAdUnit assumes there is a data property on the event, but it is never passed in handleMetric.

This causes trackProgress to never track because the data including the progress uri is missing. This might be happening to other events as well.

rambler-ui-bot commented 2 years ago

:tada: This issue has been resolved in version 2.4.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: