Superface

Track Event

analytics/track-event@1.0.0
1 provider

Track Event

Allows to send event to tracking system

Input
Event Name
Event Properties
Result
string

1.Choose a provider

2.Use TrackEvent with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('analytics/track-event@1.0.0');

  // Use the profile
  const result = await profile
    .getUseCase('TrackEvent')
    .perform({
      eventName: '',
      eventProperties: ''
    }, {
      provider: 'mock'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Input (object)

eventName
A string value representing event
eventProperties
Event Properties are attributes that help you define the specifics of an Event.

Example

{
  "eventName": "",
  "eventProperties": ""
}

Result (string)

Implementation details

Provider
mock
Use case
TrackEvent
Author
@superface
Source
Verified