Calling API Methods - Event Logging

This set of API functions allow developers to use the Foresee Eventing system to log custom events.

These are the standard set of events that get logged in Foresee products:

Survey

  • fs_inviteShown
  • fs_inviteAccepted
  • fs_inviteRejected
  • fs_inviteAbandoned
  • fs_trackerShown
  • fs_trackerClicked
  • fs_qualifierAccepted
  • fs_qualifierDeclined
  • fs_qualifierShown
  • fs_surveyShown

Feedback

TBA

 

Functions
Note: these functions should be wrapped with acsReady()

For basic usage, to log just a name on a event

FSR.Event.addEvent(<String>)

For more detailed usage, to log an event with more details

FSR.Event.addEvent(<Object>)

The object should have this format

 {
   name: 'name_of_event',
   // metrics block is optional
   metrics: {
     <metric1>: <numeric>,
     <metric2>: <numberic>
   },
   // properties block is optional
   properties: {
     <property1>: [<String>],
     <property2>: [<String>]
   },
   // data block is optional
   data: {
     <data1>: <String/numeric/boolean>,
     <data2>: <String/numeric/boolean>,
   }
 }

Sample usage

acsReady(function () {
  FSR.Event.addEvent({
    name: 'test_event1',
    metrics: {
      cart_value: 179.95,
      tax_value: 15.60
    },
    properties: {
      fs_pageUrl: [location.href]
    }
  });
}

Other articles in this section:

  1. Event Logging (current article)
  2. API Event Hooks