Appxiom Activity Markers & Lifecycle Tracking
Appxiom's iOS framework enables tracking lifecycle events and setting custom activity markers throughout the app. These markers provide a detailed activity trail, to help diagnose issues and understand user behavior when problems are reported.
What Are Activity Markers?
- Activity markers are events or actions that occur during app runtime, such as screen transitions, button taps, or custom checkpoints.
- Automatic Capture: Appxiom automatically logs key lifecycle events.
- Custom Markers: Developers can add custom own markers for granular tracking.
- Chronological Order: All markers are displayed in the order they occur.
- Issue Reporting: Markers are sent to the server only when an issue is reported.
Benefits
- Gain deep insight into user actions and app flow
- Accelerate debugging and root cause analysis
- Track both system and custom events
- No limit on the number of custom markers
Automatic Lifecycle Tracking
Appxiom automatically captures standard lifecycle events. For enhanced logging, follow the steps in Integrate NSLog Function to add log data to the activity trail.
Setting Custom Activity Markers
Developers can set custom activity markers anywhere in the app using the setActivityMarker API. These markers appear alongside lifecycle events in the activity trail when an issue is reported.
Example Usage:
- Objective C
- Swift
[Ax setActivityMarkerAt:self marker:@"clicked on payment_package_two"];
Ax.setActivityMarkerAt(self, marker: "completed login")
SwiftUI View Lifecycle Tracking
To add SwiftUI view lifecycle events to the activity trail, see Setting SwiftUI views to activity trail.
Activity Trail Example
AppDelegate:finishLaunchingOptions 11:19:24:469 45.79% FREE MEMORY
ViewController:viewDidLoad 11:19:24:708 44.39%
ViewController:viewWillAppear 11:19:27:012 45.19%
ViewController:viewDidAppear 11:19:28:515 44.53%
ViewController:clicked on payment_package_two 11:20:24:235 55.20%
Debug-Only Activity Markers
Set custom activity markers that are only active in debug builds using the setActivityMarkerForDebug API. These markers are not captured in release or production builds.
Example Usage:
- Objective C
- Swift
[Ax setActivityMarkerForDebugAt:self marker:@"logout tapped"]
Ax.setActivityMarkerForDebugAt(self, marker: "logout tapped")
Best Practices
- Use descriptive marker names for clarity in activity trails
- Place markers at key user actions and app events
- Use debug-only markers for development and troubleshooting
- Regularly review activity trails in the Appxiom dashboard to optimize app flow
- Avoid exposing sensitive data in marker names
Frequently Asked Questions (FAQ)
Q: What are activity markers used for?
A: They help track user actions and app events, providing context for issue diagnosis.
Q: Are activity markers sent to the server in real time?
A: No, they are sent only when an issue is reported.
Q: Is there a limit to the number of custom markers?
A: No.
Q: How do I set a custom activity marker?
A: Use setActivityMarkerAt in Objective-C or Swift at any point in the code.
Q: Can I add markers only for debug builds?
A: Yes, use setActivityMarkerForDebugAt to add markers that are active only in debug builds.
Q: Can I track SwiftUI view events?
A: Yes, see the SwiftUI integration guide for details.
Q: Can I customize the data sent with activity markers?
A: It is possible to set both the marker name and context. Avoid including sensitive information.
Q: How are activity markers displayed in the dashboard?
A: They appear in chronological order for each reported issue.
Q: Can I use activity markers for analytics?
A: Activity markers are primarily for debugging and diagnostics, not analytics.