Metrics Tracking

Metrics tracking allows you to measure the impact of your features and experiments. The VWO Ruby SDK provides a track_event() method to log custom events.

track_event()

Use the track_event() method to track custom events for a user:

# track event for a user
track_response = vwo_instance.track_event('event_name', { id: 'your_user_id'})

# track event with event_properties
track_response = vwo_instance.track_event('event_name', { id: 'your_user_id'}, {userType: 'paid'})

Parameter Definitions


ParameterTypeDescription
event_name
Required
StringThe unique event name you will see when creating the event in Data360. When the trackEvent() function is called, it will record a metric conversion in VWO for the given event name.
context
Required
hashContains information about the current user, including a required unique identifier for each user. Read more about userContext here .
event_properties
Optional
hashany properties of this event that you wish to pass to VWO. E.g: for a "purchase" event, some properties could be "cartValue", "currency", "shippingMethod" etc. These must be passed as key-value pairs, and the property name should exactly match what you set while creating the event in VWO > Data360>Events.