The monitoring script: what it does and where to find it

On this page

The monitoring script is the small piece of JavaScript Tapper Block runs on your website. Each protected entity has its own script, with the entity's key filled in.

What the script does

Block judges an ad click partly by what the visitor does on your site. The script runs on every page and records how each visitor behaves and which device and browser they use. These rule set settings (Setup > Rule sets) need it:

Detection settingWhat it needs from the script
Block suspicious click behaviorThe recorded behavior of each visitor, to judge whether a click came from a valid or an invalid source.
Suspicious ad clicksWhether a click was followed by any events on the page.
Minimum seconds on siteHow long the visitor stayed on your site.
Block JavaScript-disabled browsersThe fallback image in the script, which loads only when JavaScript is off.
Block repeat clicks from one deviceThe device ID, to spot one device clicking your ads from several IPs.
Aborted ad clicksWhether your page loaded and recorded any events after the ad click.

Conversions and web click tracking links rely on it too.

Where to find it

  1. With more than one protected entity, pick the entity in the switcher at the top of the sidebar.
  2. Under Setup, click Website, then Monitoring.
  3. Open the Install script and consent tab. Monitoring script is the first section.

If the tab asks you to connect an ad platform first, connect an ad account to the entity.

The same script appears in setup, at Install website monitoring. If you installed it then, you do not need to install it again.

The snippet

<!-- Tapper Monitoring Script -->
<script>
  var script = document.createElement("script");
  script.src = "https://monitor.tapper.ai/bundle.js";
  script.async = true;
  script.onload = function () {
    window.tapper.init("{public key}");
  };
  (document.head || document.body || document.documentElement).appendChild(script);
</script>
<noscript>
  <img src="https://protect.tapper.ai?pk={public key}" alt="Tapper"/>
</noscript>
<!-- Tapper Monitoring Script -->

The app fills in {public key} for you, so always copy the script from the app. How it loads without holding up your page is in Does the monitoring script slow down my website?

The section has:

  • A copy button at the top right of the code box, which copies the snippet with your key.
  • Google Tag Manager, which opens tagmanager.google.com.
  • A Content Security Policy box listing the sources your site must allow if it sends that header.
  • Open the install guide, under "Need help installing the monitoring script?", which opens the Monitoring Script guide on docs.tapper.ai.

The Monitoring script section with Copy monitoring script and Google Tag Manager

Where it goes on your site

Install it once on every page, one of these ways:

On WordPress or another site builder, use Google Tag Manager or the builder's option for adding code right after the opening <body> tag.

After you install it

Still need help?

Chat with our team and mention this article.