Skip to content

Add Client-side Tracking

The final step is setting up a tracking script. It requires a head tracking script between the <head></head> tags on your website, a main script after the head script, and cookie consent. For more information about setting up a tracking script, see a tutorial in Raptor documentation.

Now, you need to add a tracker to specific places in your website where you want to track users. For example, add this tracker to the Landing Page template to track user entrances.

raptor.trackEvent('visit', ..., ...);
or purchases:

  //Parameters for Product 1
raptor.trackEvent('buy', ..., ...);
  //Parameters for Product 2
raptor.trackEvent('buy', ..., ...);

For tracking to be effective, you also need to send ID of a logged-in user in the same way. Add the user ID information by using below script:


For more information on tracking events, see the documentation.