Skip to content

Name movies and shows

Call this once per page, as soon as you know the title:

webstats('content', {
type: 'movie',
ids: { tmdb: '278' },
title: 'The Shawshank Redemption',
});
KeyRequiredWhat it does
typeyesWhat kind of thing it is. See content types.
idsyesOne or more provider ids. At least one entry, or the call is dropped.
titlesee belowThe name shown in reports.
episodeoptional{ ids, season, number, title } for a show episode.

A tmdb or imdb id resolves on its own. Every other provider resolves on the title string instead, so if you send mal, isbn, igdb or similar, an accurate title is what makes it work. Sending both is always safe.

Without this call, reports group by URL: /watch/8f21c tells you nothing, and one film under two URLs counts twice. It also decides what you earn. See Get paid.

Only watch and detail pages need it. Your home page and listings do not.

webstats('content', {
type: 'tvshow',
ids: { tmdb: '1399' },
title: 'Game of Thrones',
episode: { season: 1, number: 1, title: 'Winter Is Coming' },
});

The episode number key is number, and season and number must be numbers, not strings. season: '1' or episode: 1 drops the whole declaration, not just the episode part, so the page ends up with no title at all.

Episode detail enriches your reports. Identification and earnings work off the parent title, so a show earns the same whether or not you break out the episode.

Same call, a different type and a provider that suits it:

webstats('content', { type: 'anime', ids: { mal: '16498' }, title: 'Attack on Titan' });
webstats('content', { type: 'book', ids: { isbn: '9780451524935' }, title: 'Nineteen Eighty-Four' });

All 12 types and the ids each accepts are in Content types and ids.

Your siteCall it
Server-rendered pageIn a type="module" <script>, after your snippet
Single-page appWhen the route’s data arrives, before the player starts
Loaded from an APIIn the API response handler. See Streaming apps
Inside an iframeInside the frame, never on the parent. See Iframes

They answer different questions, and most catalog sites send both:

webstats('content', { type: 'movie', ids: { tmdb: '278' }, title: 'The Shawshank Redemption' });
webstats('video', '#player', { id: 'tmdb-278', title: 'The Shawshank Redemption', tmdb: '278' });

content labels the page, so traffic reports group by title. video labels the player, so plays and watch time group by title. See Track video.

Load a watch page, then open Content in your dashboard. The title appears within seconds.

If it does not, check the two things that silently drop a call: an empty ids object, and a type that is not in the supported list.