Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

The events that you log must be objects, however they can take any form that you like. You should put some thought into what values you will log from an event, keeping in mind that you'll most likely want to categorise the data for display purposes later.


The following is an example of a single event object, with a multitude of values included. It's important to note that you can pass whatever values you please into these events:

// Format your event
const formattedEvent = {
  category: "Videos",
  action: "Start",
  label: "HowTo",
  value: Date.now()
}



To send a single custom event, using the logEvent() method, and the formattedEvent object we configured previously:

// Log your event
collector.logEvent("Server CLI Request", formattedEvent)
  .then((analyticsEvent) => {
    // The logEvent() method returns a Promise
    // that resolves to the event
    // sent to the analytics service
    console.log(analyticsEvent)
  })
  .catch((err) => {
    throw Error(err)
  })


Congratulations, your custom events will now be logging to the BlinkMobile Simple Analytics Service Database.


From there, your events can be accessed with MongoDB queries using our Dashboard Console. For more information, please see the link under Further Reading.

Further Reading

Displaying Your Collected Analytics Data in a Dashboard

  • No labels