Testing your integration
Before shipping, confirm two things: the SDK is running, and events you fire actually reach the Amply dashboard. This page shows the helpers you use to verify each step locally, and the log controls that surface what the SDK is doing internally.
A PM should read this as: "the SDK has built-in diagnostic helpers — the developer can print the last events, inspect the current state the SDK knows about, and turn on verbose logging during integration."
Use this when you're integrating the SDK for the first time, debugging a campaign that won't fire, or tracking down why an event doesn't show up in the dashboard.
Don't use this when you're investigating a production-only issue — the debug helpers are meant for local or staging builds, and some signals (like session boundaries on iOS) only reproduce on a real device or simulator. Leave debug logging off in release builds.
Turn on verbose logging
During integration, set the log level to debug. Production apps should leave it at none (or error).
amply.setLogLevel(level: "debug")
// or
amply.setLogLevel(level: .debug)import tools.amply.sdk.logging.LogLevel
amply.setLogLevel(LogLevel.DEBUG)
// or
amply.setLogLevel("debug")import Amply from '@amplytools/react-native-amply-sdk';
Amply.setLogLevel('debug');You can also set debug: true in the initialization config — it's shorthand for logLevel: 'debug' and pipes SDK logs into the Metro console.
Log levels, least-to-most verbose: none, error, warn, info, debug.
Inspect recent events
The SDK keeps a local list of the events it has seen — both the custom ones you tracked and its own system events. Useful for sanity-checking that your track calls actually landed before they've been flushed to the backend.
Task {
let events = try await amply.getRecentEvents(limit: 30)
for event in events {
print("\(event.timestamp) \(event.name) \(event.type) \(event.properties)")
}
}lifecycleScope.launch {
val events = amply.getRecentEvents(limit = 30)
events.forEach { e ->
Log.d("Amply", "${e.timestamp} ${e.name} ${e.type} ${e.properties}")
}
}const events = await Amply.getRecentEvents(30);
console.table(events.map(e => ({
name: e.name,
type: e.type,
ts: new Date(e.timestamp).toISOString(),
})));limit defaults to 30. Events are returned newest-first.
Inspect what the SDK knows about the user
getDataSetSnapshot returns the current state of a named dataset — device info, user attributes, current session, recent events, or triggered event counts. Use it to verify that setUserId, setCustomProperties, and your track calls have the effect you expect.
Available datasets:
@device
Device and app fields (model, OS version, advertising identifier, app build, locale)
@user
The user ID and related user-level data
@custom
The custom properties you set via setCustomProperty / setCustomProperties
@session
Current session (start time, session index, source)
@triggeredEvent
Counts for a specific triggered event name
@events
Counts / aggregates for a set of events
Verifying events reach the dashboard
Once the SDK is running with debug logging on:
Open the Amply dashboard for your application.
Fire a test event from the app (a screen view, a button tap).
Watch the device console for
[Amply]log lines confirming the event was queued and flushed.Open the dashboard's event view and look for the event name.
If the event appears in getRecentEvents but not in the dashboard after a minute, check:
The app has network access.
The app was initialized with the correct
appId,apiKeyPublic, andapiKeySecretfor your project.The SDK logs don't show authentication or network errors (turn log level up to
debug).
If the event doesn't appear in getRecentEvents at all, the call to track didn't reach the SDK — check for typos, make sure the SDK is initialized, and that you're not calling from a build variant with a different configuration.
Quick diagnostics checklist
SdkInitializedfires (see Handling callbacks)getDataSetSnapshot({ kind: '@device' })returns a non-empty mapgetDataSetSnapshot({ kind: '@user' })reflects theuserIdyou setgetDataSetSnapshot({ kind: '@custom' })reflects the custom properties you setgetRecentEvents(30)shows your last few tracked eventsThe dashboard shows the same events within ~1 minute
Related
Tracking events — what you're verifying
User attributes — set user ID and custom properties to inspect
Handling callbacks — subscribe to SDK lifecycle for deeper diagnostics
iOS SDK reference — exact signatures
Android SDK reference — exact signatures
React Native SDK reference — exact signatures
Last updated