Installation
Understand more regarding analyzing user behavior at Apps > Analytics
Additional Configuration
This App requires some additional configuration, if you would like to automaticaly track certain types of events:
Frontend (Browser)
To automatically track page views and page leaves, turn on Autocapture when you configure the SDK:
DashX.configure({
// ... other configuration options
autocapture: true // optional, defaults to false
});
To also track clicks and form submits, pass { clicks: true } instead of true. The data shows up in Web Analytics.
Frontend (Mobile)
- Android
- iOS
- React Native
To automatically track app lifecycle events and screen views, enable them once after DashX.configure(), typically in your Application.onCreate. App-level lifecycle events and $screen need dashx-android 1.5.0 or later:
DashXActivityLifecycleCallbacks.enableActivityLifecycleTracking(this)
DashXActivityLifecycleCallbacks.enableScreenTracking(this)
Additional Configuration for Android
If you wish to track the current location of the user / visitor, then ensure the following permissions are added to the AndroidManifest.xml file:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
If the above permissions are not granted, location data is not sent to DashX and DashX will use the IP address to decide the city and country of the user.
If you wish to track network information such as Bluetooth, Cellular & Wi-Fi status, then ensure the following permissions are added to the AndroidManifest.xml file:
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Call these once after DashX.configure(), typically in application(_:didFinishLaunchingWithOptions:). Both need dashx-ios 1.6.0 or later:
DashX.enableLifecycleTracking()
DashX.enableScreenTracking()
Enable lifecycle tracking after configure, and track screens from your React Navigation container:
DashX.enableLifecycleTracking();
<NavigationContainer
ref={navigationRef}
onReady={() => DashX.trackNavigation(navigationRef)}
>
{/* ... */}
</NavigationContainer>
Lifecycle tracking sends these events:
| Event | When | Data |
|---|---|---|
| Application Installed | First launch after install | version, build |
| Application Updated | First launch after an update | version, build, previous_build, previous_version |
| Application Opened | Every other launch, and each return to the foreground | version, build, plus from_background on a return to the foreground |
| Application Backgrounded | The app goes to the background | session_length, seconds in the foreground |
| Application Crashed | An uncaught exception: on iOS an Objective-C exception, not a Swift runtime error such as fatalError; on Android, after DashXExceptionHandler.enable() | exception |
A launch in the background (for example for a silent push) is not an open; the launch event is sent when the app first comes to the foreground.
Screen tracking sends $screen with $screen_name set to the screen name: on iOS the view controller's title, then navigationItem.title, then its class name; on Android the Activity's android:label, then its class name; and the route name on React Native. Calling DashX.screen() yourself sends the same event, so a screen you report yourself and also track automatically is sent twice. On iOS, container and system controllers are skipped and SwiftUI screens need a title; see automatic screen tracking. On Android, Fragments and Jetpack Compose navigation inside one Activity are not tracked; see automatic screen tracking.
dashx-ios 1.6.0 and dashx-android 1.5.0 renamed Screen Viewed to $screen, with the screen name in $screen_name instead of name, and dx_deep_link_opened to Deep Link Opened. dashx-ios 1.6.1 and dashx-android 1.5.0 renamed dx_notification_navigated to Push Notification Tapped, with the same data. Update any reports, flows or filters that use the old names. Apps on older versions keep sending the old names until they upgrade.
Track Events
On the Backend, you would need to call track() using the User ID, Event Name, and Event Data.
On the Frontend, you would need to call track() using the Event Name, and Event Data.
You don't have to specify a User ID in the Frontend SDKs, because it is derived from the current identity.
Learn more about setting identity from the Account Center guide.
Backend
- Node.js
- Spring Boot (Java)
- Python
- Ruby
dashx.track('<USER ID>', 'Plan Renewed', {
plan: 'Bronze',
months: 12
});
dashX.track("Plan Renewed", "<USER ID>", Map.of(
"plan", "Bronze",
"months", 12
));
dashx.track('<USER ID>', 'Plan Renewed', {
plan: 'Bronze',
months: 12
})
dashx.track('<USER ID>', 'Plan Renewed', {
plan: 'Bronze',
months: 12
})
Frontend (Browser)
- JavaScript
import dx from 'lib/dashx'
dx.track('Button Clicked', {
label: 'Sign me up',
placement: 'top'
});
Frontend (Mobile)
- iOS
- Android
- React Native
DashX.track("Button Clicked", withData: [
"label": "Click here",
"placement": "top"
])
DashX.track('Button Clicked', {
label: 'Sign me up',
placement: 'top'
});
import DashX from '@dashx/react-native';
DashX.track('Button Clicked', {
label: 'Sign me up',
placement: 'top'
});
User Privacy
DashX favors privacy by default, so many of the tracking features are disabled out-of-the-box. We force developers using our SDK to enable each tracking feature, so that they are aware of the exact pieces of data being tracked.
In the browser SDK, Autocapture is off until you turn it on, and capturing clicks and form submits is a separate opt-in on top of page views. You can keep personal data out of what it sends, and skip parts of your pages, with its privacy controls.
Third-Party Processing & Regulations - If you reside in the EU region, or if your app belongs to an industry that is heavily regulated, you have two options:
- Using a Self-Hosted version of DashX, which allows you to keep all your data within your own Data Center(s).
- Using specific Data Center(s) of DashX, which are available in different Regions.
Reach out to your Account Manager, or sales@dashx.com to know more.