Prerequisites
Before you begin, you’ll need:- A Vero account (sign up here if you don’t have one)
- Your Tracking API key, found on the Settings page of your Vero account
Choose your integration method
JavaScript/TypeScript SDK
Recommended for websites and front-end applications.
NPM Package
For React, Node.js, and other JavaScript build environments.
REST API
For server-side integrations in any language.
Community SDKs
Ruby, PHP, and other community-maintained libraries.
Install the JavaScript SDK
Add the following to the<head> section of every page you want to track, replacing <YOUR_TRACKING_API_KEY_HERE> with your API key. You can find your Tracking API key on the Settings page of your Vero account.
This SDK is also available as an NPM package for advanced use cases (e.g., integrating in React or Node.js applications). Refer to the package’s README for more information.
Identify a user
When a user logs in, calluser.identify with their id and email (both required). This adds or updates the user in your Vero data store.
Track an event
An event represents a user action in your application, such as viewing a product or completing a purchase.user.identify before calling event.track, unless you supply an identity object to the method. Once you call user.identify, the SDK stores the id and email in local storage for future requests.
Tracked events will appear on the Events page in your Vero account, where you can view recent occurrences, event properties, and which campaigns use each event as a trigger. Learn more about events in Vero.
Unidentify a user
When a user logs out, calluser.unidentify so future events are not associated with them.

