Jesper Hägglund
Jesper Hägglund

Reputation: 11

elapsedVideoTimeRatio does not return 100 datapoints google api

I'm using the the google api to measure the retention and acccording to their docs it should always return 100 datapoints but I'm getting lower than that, some as low as 71? Does anyone else have a similar problem? Do they have a support forum for google devs? I could not find any.

Here is their documentation: https://developers.google.com/youtube/analytics/dimensions#elapsedVideoTimeRatio

I tried to call the youtube api from npm googleapis package, this is just illustration and does not show the whole code but I guess you get the idea:

import { google, youtubeAnalytics_v2 } from 'googleapis';
  const response = await youtubeAnalytics.reports.query({
          dimensions: 'elapsedVideoTimeRatio',
          metrics: 'audienceWatchRatio',
          // from publish time to now
          startDate: formatDate(post.publishedOn, DATE_FORMAT),
          endDate: formatDate(new Date(), DATE_FORMAT),
          filters: `video==${VIDEO_ID}`,
          ids: channel.contentOwner
            ? `contentOwner==${channel.contentOwner.id}`
            : `channel==${channel.channelId}`,
        });

Upvotes: 1

Views: 47

Answers (0)

Related Questions