Skip to main content
Radar runs on your site through a single <script> tag. The tag loads the tracker from taap.it and tells it which project the visits belong to. This page explains the tag attribute by attribute, where to put it, and which data needs a line of code from you.

The tag

What each attribute does

Keep the tag as your dashboard gives it. Nothing goes between the opening <script ...> and the closing </script>: a comment or a stray </body> pasted inside breaks it.

Find your project key

The key is the pk_... value inside the script. You do not need to build the tag by hand: Radar gives you the whole script with your key already in it.
  • When you create the project: the second setup step shows the script with a copy button.
  • Later: open the project in Radar, go to its settings and open the script section.
One project is one website, and each project has its own key. If you run several sites, each one gets a different script.
A tag with the wrong key leaves your dashboard empty. If nothing shows up, compare the key on your site with the key of the project you are looking at.
The project key is not a secret. It sits in the code of your pages, where anyone can read it. Do not confuse it with a Radar API key, which you create in the API tab of the project settings: an API key reads your data and must never appear in the code of a public page. In these docs, pk_xxxx is a placeholder. Replace it with your own key.

Where the tag goes

  • In the <head>. Place it just before the closing </head> tag.
  • On every page. A page without the tag is a page Radar cannot see. In a framework, put it in the file that wraps all pages, such as the root layout or the HTML template. See the installation page for your stack, starting from get started.
  • Only once. If you move the tag, for example into a tag manager, remove the old copy so the script does not load twice.
  • On a domain the project knows. A project accepts data from the domain you entered when you created it. To send data from another address, add it in the additional domains section of the project settings. See track several websites or domains.
  • On your published site. Radar receives nothing until the change is live. Test on the deployed site, not on a copy running on your own computer.
You can also load the same script from a tag manager. See install with Google Tag Manager.

What Radar collects on its own

Once the tag is on every page, this arrives without any other code:
  • Page views, visits and visitors. A visit is one trip to your site, also called a session. A visitor is one person, who can make several visits.
  • Where visitors come from: source, channel and referrer (the site that sent them).
  • Where they are and what they use: country, device, browser and operating system.
  • The pages they view, including the page where a visit starts and the page where it ends.
  • Outbound link clicks and form submissions, through the two data-track-... attributes of the tag.

What needs a custom event

Radar cannot guess what happens inside your own code, such as a sign-up that succeeds or a payment on a page you built. For those, your code tells Radar with a custom event: a named action you send yourself. The script makes a visitors object available on the page. Call visitors.track with the name of the event and, if you want, an object of properties:
For a sale on a custom payment page, the event looks like this:
Three things to know:
  • There is no separate identify method. A visitor becomes identified when their details travel on a custom event, or automatically when Stripe is connected. See identify visitors, and read privacy and consent before you identify people.
  • Stripe Checkout needs no event. If you connect Stripe and your customers pay on the Stripe Checkout page, the connection is enough. The payment event is for payment pages you built yourself. See track revenue.
  • Radar has no webhooks. To get your custom events out of Radar, read them through the API at /api/v1/radar/custom-events. See the custom events endpoint. The Radar API is available from the Pro plan.
Custom events are available from the Starter plan. Compare plans on the pricing page. The developer guide is in custom events. For how to read the events report in your dashboard, see the Help Center article on custom events.