Lesson 2

How to track events in the browser with IntemptJS

Full API reference for IntemptJS — event tracking, user identification, consent, and product tracking in the browser.

Video comingThe video is being filmed. The steps below are the whole lesson.

In this lesson

  1. 1In the console go to Integrations, add a source for your platform (Configure JavaScript, Node JS, Python, PHP, iOS, Android or React Native), name it, and copy the Installation Snippet and Source ID.
  2. 2Browser: add the queue stub and <script async src="https://cdn.intempt.com/v1/intempt.min.js?organization=...&project=...&source=...&key=..."> to the page <head>. Test on a real domain, not localhost.
  3. 3Browser: call intempt.identify({ userId }) then intempt.track({ eventTitle, data }) with non-empty data.
  4. 4Open Events, then the Live tab, and watch your event arrive. Do not skip the wait.
Read the reference docs for this lesson

Setup checklist

The 18 steps to ship the SDK, from your first line of code to an identified event in Live. Tick them off as you go; your ticks stay in this browser.

Open the setup checklist (PDF)

0 of 18 ticked

You are done when

  • Your custom event appears on Events, Live in the console.
  • The event is attached to the identified user's profile, not an anonymous one.
  • Browser only: tested on a real domain, since tracking is blocked on localhost.
  • Server SDKs: flush or close ran so buffered events were sent before the process exited.

Your tech stack and tools

The core stack (everything you actually need)

Highly recommended optional upgrades that level up your work

Every SDK is free. Your first 100K events a month are included on every plan.