How to install the MediaSafe counter
One tag in <head> — and signal collection starts right away.
1. Copy your counter
Go to your dashboard → "Settings" → copy the code under your site. It looks like this:
<!-- MediaSafe -->
<script src="https://ingest.mediasafe.cc/collector.js"
data-site="YOUR_KEY" async></script>
<!-- /MediaSafe -->
2. Insert into <head>
The code must be inside your site's <head> tag — before the closing </head>. The async attribute guarantees the counter won't slow down page load.
If you use WordPress
Insert the code via a plugin like "Insert Headers and Footers", or directly in your theme's header.php, before </head>.
If you use Tilda / a site builder
In your site settings, find "Additional code in head" and paste the counter there.
If your site runs React/Vue/Next.js
Add the tag to your root HTML template (index.html or _document.js) — manually, the counter doesn't require an npm package.
3. Check that data is coming in
Open your site in a browser, wait 1–2 minutes, then refresh "Overview" in the dashboard — at least one visit should appear.
4. Custom parameters (optional)
If you want to send your own data along with visits (e.g. user plan, cart value), add this snippet BEFORE the counter tag — it works even if called before the counter loads:
<script>
window.mediasafe = window.mediasafe || function () {
(window.mediasafe.q = window.mediasafe.q || []).push(arguments);
};
</script>
Then call it anywhere on the page, any number of times:
mediasafe('params', { plan: 'pro', cartValue: 1500 });
These parameters will appear in "Visit parameters" and "Visitor parameters" reports in your dashboard.
Common issues
- No data after 10+ minutes — check that the script actually loads (Network tab in DevTools, status 200 on collector.js)
- Wrong site key — double-check
data-siteagainst what's shown in the dashboard - Ad blockers — some extensions may block third-party scripts; this doesn't affect real users without blockers