Custom Events
Generates: Logs
Track discrete business-level actions and milestones.
If you're using Mixpanel, Amplitude, Firebase Analytics, Segment, or similar — you can bridge those calls to Pulse.trackEvent alongside your existing tracking. This means zero additional instrumentation effort: every business event you already track automatically flows into Pulse too.
These events are the raw signal that Pulse uses to derive Interactions (user journey flows; see the Android doc map from Android APIs for the native interactions guide) — automatically composed, scored with Apdex, and surfaced in the dashboard.
Usage
import { Pulse } from '@dreamhorizonorg/pulse-react-native';
// Simple event
Pulse.trackEvent('user_logout');
// Event with attributes
Pulse.trackEvent('purchase_completed', {
product_id: 'SKU-123',
price: 49.99,
quantity: 2,
in_stock: true,
});
Supported attribute types: string, number, boolean, and arrays of these.
Correlation with Spans
Events tracked while a span is active automatically include span_id and trace_id, linking them to the operation in progress:
const span = Pulse.startSpan('checkout');
Pulse.trackEvent('payment_method_selected', { method: 'card' });
Pulse.trackEvent('shipping_address_entered', { country: 'US' });
span.end();
Native side
If you need to emit custom events from native code — Kotlin/Java or Swift/Objective-C — rather than from JS:
- Kotlin (Android)
- Swift (iOS)
import com.pulsereactnativeotel.Pulse
Pulse.trackEvent(
name = "purchase_completed",
observedTimeStampInMs = System.currentTimeMillis(),
params = mapOf("product_id" to "SKU-123"),
)
import PulseReactNativeOtel
PulseSDK.trackEvent(
name: "purchase_completed",
observedTimeStampInMs: Int64(Date().timeIntervalSince1970 * 1000),
params: ["product_id": "SKU-123"]
)
Details and Objective-C: Android APIs · iOS APIs.