Custom Interactions
Available for plans: Standard - Free, Standard, Premium, Enterprise and Ultimate. |
A CRM Analytics license is required to view and access CRM Analytics assets in Unified Analytics. |
Produce Your Own Logs with Custom Interactions
Custom Interactions is a feature that allows you to define your own log events to track as part of app analytics.
Salesforce's AppExchange App Analytics (the data that powers the ISV Analytics app) includes your app usage logs with a predefined list of log events - such as opening a Lightning page, creating a record, or receiving a REST call. (To learn more about predefined log events, refer to the official Salesforce documentation.)
Custom Interactions enable you to go beyond that predefined list and track critical events in your app's lifecycle, such as:
- A user completes a business process with success or failure.
- A user reaches a milestone, indicating they have begun to derive real value from your app (have you heard of the aha moment concept?).
- An automated process is launched for the n-th time and exceeds a specific threshold.
- A caught exception occurs - your app might have a fallback route, but you'd likely want to know if it happens frequently.
- A user completes the end-to-end path of a process - you can log custom interactions at each stage to understand the detailed customer journey.
How to Use the Custom Interactions Feature
Log Interactions in Apex
Here's an example of how you can use custom interactions to log caught exceptions. We implement this similarly in the ISV Analytics app ;)
-
First, define an Enum (or multiple Enums) for your custom interaction types.
public class CustomInteractionTypes {
public enum AppCaughtExceptions {
AI_API_ERROR,
ORDER_CANCELLATION_FAILED,
ORDER_RENEWAL_FAILED
}
} -
Then, call the
IsvPartners.AppAnalytics.logCustomInteraction
method from your Apex code, passing the appropriate enum as an argument.public inherited sharing class AiApi {
public void doSomethingClever() {
try {
// Do something clever
} catch (Exception e) {
IsvPartners.AppAnalytics.logCustomInteraction(
CustomInteractionTypes.AppCaughtExceptions.AI_API_ERROR
);
// ... your other fallback logic
}
}
} -
Voilà! When you include this change in the new package version, Salesforce will automatically start collecting your custom interaction logs. You will be able to see them in the ISV Analytics dashboards.
For more details about logging custom interactions, refer to the Salesforce documentation in the Resources section below.
Observe Your Interactions in ISV Analytics
The custom interactions logged by your package are visualized on the Custom Interactions tab in ISV Analytics.
Open the ISV Analytics
app from the app launcher and navigate to Custom Interactions
.