Skip to content

WordPress

There is no vidstats plugin. Pick one of these three routes, not all three.

No theme files to touch, and it survives theme updates.

  1. Install a code-injection plugin. Insert Headers and Footers and WPCode both cover this on their free tiers.
  2. Open its settings and find the Footer or Scripts in Footer box, which outputs just before </body>.
  3. Paste the first line only of your snippet, then save.

Copy your snippet from Pixels. It carries your install tag key and tracking domain.

<script defer src="https://10.vidstats.top/js/p.js?s=YOUR_TAG_KEY"></script>
<!-- Video pages only. Delete this block on pages with no video. -->
<script type="module">
window.webstats('content', {
type: 'movie',
ids: { tmdb: '278' },
title: 'The Shawshank Redemption',
});
</script>

A header plugin puts whatever you paste on every page. Paste the content block there too and every page on your site claims to be the same film. Use the loader line site-wide, then emit the content call per post with option 2.

For sites that already maintain a child theme, and the only option that names each film correctly. Add this to the child theme’s functions.php, with the host and key from your own snippet:

function vidstats_pixel() {
echo '<script defer src="https://10.vidstats.top/js/p.js?s=YOUR_TAG_KEY"></script>';
// Name the title, on single film posts only. Swap in your own post type and meta key.
if ( is_singular( 'movie' ) ) {
$tmdb = get_post_meta( get_the_ID(), 'tmdb_id', true );
if ( $tmdb ) {
printf(
'<script type="module">webstats("content",{type:"movie",ids:{tmdb:%s},title:%s});</script>',
wp_json_encode( (string) $tmdb ),
wp_json_encode( get_the_title() )
);
}
}
}
add_action( 'wp_footer', 'vidstats_pixel' );

wp_footer fires just before </body> on every page, so one hook covers the whole site. wp_json_encode is what keeps a title containing an apostrophe or a quote from breaking the script tag.

If your films have no TMDb id in post meta, send the title alone and it resolves on the title string. See Name movies and shows.

Go to Appearance then Theme File Editor, open footer.php, and paste the loader line just before the closing </body>. The same warning as option 1 applies: footer.php is every page, so the content call does not belong there.

Edit the child theme’s footer.php if you have one: editing a parent theme means the next update wipes your snippet. If your child theme has no footer.php, use option 1 or 2.

View the source of any page and search for p.js. The tag should be just before </body>. Then open your dashboard: your own visit shows up within seconds.

If the tag is missing from the live page but present in your theme, a caching plugin is serving an old copy. Clear its cache.

A self-hosted video block renders a real <video> element, so it is measured as soon as the pixel is live. Set the pixel’s site type to File host or Media player as well: a new pixel starts on Dwell, which counts time on the page rather than reading the player, and is the usual reason a fresh WordPress install reports no plays.

Anything that renders as a third-party iframe cannot be read from the parent page. That covers YouTube and Vimeo embeds, and VideoPress in its hosted iframe form. You can still record that the embed was shown: see Iframes.