Skip to main content
To send targeted campaigns based on customer behavior, you need to track events to Vero. This guide covers how to install Vero’s tracking library and start capturing user data.

Before you begin

You’ll need:

Integration options

There are several ways to send data to Vero:
MethodBest for
JavaScript libraryWebsites and web applications
SegmentTeams already using Segment for data collection
RudderstackTeams already using Rudderstack for data collection
REST APIBackend systems and server-side tracking
See Integrations for a full list of supported data sources.

Install the JavaScript library

The JavaScript library is the recommended way to track users and events from your website.

1. Add the tracking snippet

Add the following code before the closing </head> tag on every page of your website:
<script>
var _veroq = _veroq || [];
_veroq.push(['init', { api_key: 'YOUR_API_KEY' }]);

(function() {
  var ve = document.createElement('script');
  ve.type = 'text/javascript';
  ve.async = true;
  ve.src = '//d3qxef4rp70elm.cloudfront.net/m.js';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(ve, s);
})();
</script>
Replace YOUR_API_KEY with your API key from Settings > Project in Vero.
You can also install the snippet using Google Tag Manager or another tag management system.

2. Identify users

Call the user method when a user logs in, signs up, or otherwise provides their email address:
_veroq.push(['user', {
  id: '12345',
  email: 'jane@example.com',
  first_name: 'Jane',
  last_name: 'Smith'
}]);
The id field should be a unique identifier for the user in your system. The email field is required to send email campaigns. You can include any additional properties you want to store on the user profile, such as plan, company, or signup_date.

3. Track events

Call the track method whenever a user performs an action you want to capture:
_veroq.push(['track', 'Viewed product', {
  product_name: 'Red T-shirt',
  product_price: 29.99,
  product_url: 'https://example.com/products/red-t-shirt'
}]);
The first parameter is the event name. The second parameter is an object containing event properties that provide context about the action.

Event naming tips

  • Use consistent naming conventions (e.g., Viewed product or viewed_product)
  • Vero treats different capitalizations and spaces/underscores as the same event
  • Choose descriptive names that your team will understand

Using the REST API

For server-side tracking or backend systems, use the Track API directly:
curl -X POST https://api.getvero.com/api/v2/events/track \
  -H "Content-Type: application/json" \
  -d '{
    "auth_token": "YOUR_API_KEY",
    "identity": {
      "id": "12345",
      "email": "jane@example.com"
    },
    "event_name": "Completed purchase",
    "data": {
      "order_id": "ORD-789",
      "total": 149.99
    }
  }'

Verify your setup

Once tracking is installed:
  1. Trigger a test event on your website
  2. Navigate to Data > Events in Vero
  3. Confirm your event appears in the events list
  4. Click on the event to view recent occurrences and properties

Other libraries

Vero provides helper libraries for additional languages: See the Developer documentation for more details.