<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 thepk_... 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.
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.
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 avisitors 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:
- 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
paymentevent 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.