Salesforce AppExchange App Analytics
How do you know if anyone is actively using your AppExchange app? How can you tell which features are being utilized and which are left untouched? Is there a way to identify top customers and determine which ones need attention to prevent churn? Can you find out where your users are located to focus your marketing efforts there?
Great questions, my fellow ISV! The answer to these and many more lies in AppExchange App Analytics!
The original and more interactive version of this article is published on our blog - you can access it here - original article version - AppExchange App Analytics.
What is AppExchange App Analytics and what can I gain from it?
Before learning how to configure all the fancy stuff, let’s first understand the topic and set clear expectations.
Salesforce provides a native mechanism to collect usage logs generated by your app – AppExchange App Analytics. Various types of logs are collected, but their main purpose is to gather information on how your clients are using your app.
There is tons of information you can obtain from these logs. Some examples include:
You probably already have some ideas on how this data can help your business and product development. However, let me throw a few of mine:
Is this as perfect as it sounds? I will cover this in the next sections, but for now, I hope you have a good understanding of the data that can be available to you.
And what data is not?
I’d like to note that AppExchange App Analytics data is strictly related to your app’s usage. Statistics about SEO, most-relevant search terms, and events that lead to your app’s installation are tracked separately as part of Salesforce Marketplace Analytics.
Types of Collected Logs
Salesforce collects three types of logs for your app:
Due to the data granularity and retention period considerations, different logs are collected from different customer orgs. Here’s a comparison from Salesforce documentation:
Prerequisites for Log Collection
To use AppExchange App Analytics, your package must pass the security review and be registered in your License Management Org.
The Package Usage Summary logs are enabled by default, but to start collecting Subscriber Snapshots and Package Usage Logs, you need to take additional action - different depending on whether you have a 1GP (first-generation packaging) or 2GP (second-generation packaging) managed package:
sf package update --package "Your Package Alias" --enable-app-analytics
How to Download App Analytics Logs
Ok, you’ve met all the requirements. What now? The only way to download the App Analytics logs is by creating AppAnalyticsQueryRequest records. These represent requests sent to Salesforce to receive logs of a specific type for a specified timeframe. You can create such a record via an API call or by executing Apex code.
Probably the easiest way to do this yourself is by using Workbench – a simple tool that allows you to send API requests to your Salesforce org using a visual interface.
Here is a step-by-step example where I request and download Package Usage Logs for my app for the period August 10-16, 2024:
1. Go to https://workbench.developerforce.com and log in using your License Management Org (LMO) credentials (unless you specifically requested otherwise, these are just the credentials for your Partner Business Org – the org created for you when you became a Salesforce ISV/OEM Partner).
2. In the Select an action to perform section, select the Insert action, choose the AppAnalyticsQueryRequest object, and click Select.
3. Choose the Single Record option on the next screen and click Next.
4. Now, fill in the fields for your request and click Confirm Insert.
I populated only the required fields (type of logs and start/end time), but you can fill in the others to customize your request. Here’s a quick summary of the AppAnalyticsQueryRequest object fields:
To learn more about the AppAnalyticsQueryRequest structure, refer to the official documentation.
5. Click on the Salesforce ID value displayed on the confirmation screen.
6. You will see the AppAnalyticsQueryRequest record you’ve just created. Salesforce has 15 minutes to update its state and populate the DownloadUrl field. Unless your app is used very heavily, this usually takes up to a minute. Refresh the page until you see the RequestState change to Complete and the DownloadUrl field populated with a URL.
7. The final step is to copy the DownloadUrl value to a new browser tab and download the logs (note: the download link expires in 60 minutes). Here’s a screenshot of what these logs look like:
If you want to learn about the columns displayed here, scroll down to the App Analytics Logs Structure section.
How to Visualize App Analytics Logs
You need to handle the logs visualization yourself. Salesforce recommends uploading them to CRM Analytics (Salesforce’s native tool for data visualization). Here’s an end-to-end guide on how to utilize CRM Analytics to visualize your app usage logs. If you have plenty of time to dedicate or plan to build your own automation for the logs retrieval process, or you’re already familiar with CRM Analytics, this is a great option. The product is very powerful and allows you to create very great visualizations. But if you’re not a CRM Analytics expert (or don’t have a developer who is) and want to see your data quickly, you should probably stick to Excel or your own BI tool.
Here’s a sample Excel visualization of the number of interactions with your app’s components by specific customers ("Foo, Inc." and "Bar, Inc."):
If you’re thinking now "Uhh, not too sexy", let me assure you that this is just a simple example. If you really spend some time on the visualization preparation or invest in a ready-to-go solution, the results can be truly impressive.
Here is a screenshot of app usage visualization in our own data analytics solution – ISV Analytics:
App Analytics Logs Structure
The three types of logs contain different information with varying levels of granularity. I won’t describe all the log columns here, but you can reference them in the official Salesforce Documentation:
However, there are some common concepts and columns across all these log types. Here are the most important columns that provide an overall understanding of what is being collected:
Your Custom Logs
Salesforce collects a lot of entity types out of the box, which already provide great insights into your app’s usage. However, there are certain use cases where you may need to collect custom logs to track app-specific events. Here are a few examples:
This is where Custom Interactions come into play. I will leave you with the pleasure of reading the details in the official documentation, but to summarize, you can create custom interaction logs directly from your Apex code - giving you the ability to decide on the logging granularity and frequency.
How to Make It All Easier
Let’s recap all the steps needed to view your app usage data.
Doing this manually every time you want to see up-to-date usage data for your app seems like a hopeless quest. And what if you want to compare usage trends over time? Would you append the new data to the same Excel sheet manually all over again?
Fortunately, there are ways to improve this process drastically.
Build Your Own Automations and Visualizations
This one is pretty easy to describe. You can automate the entire process yourself – request the logs every X days/hours, download them automatically, inject them into the visualization tool, and visualize.
The unquestionable advantage of this approach is that you control everything and build a solution that 100% matches your needs.
The downside is that you will likely spend much more money (and time) than buying a ready-to-go solution – apart from the usual development challenges, there are many restrictions on App Analytics requests (e.g., the max number of parallel requests, the max amount of data you can download in 24 hours, testing restrictions, etc.).
Use a Free Semi-Manual App
You can use one of the free AppExchange App Analytics apps published by Salesforce Labs – App Analytics and Package Visualizer. I will cover the latter one as it has more additonal features. It allows you to see some basic information about your app (such as the package details, package versions list, list of subscriber licenses) and gives you the ability to request App Analytics logs from the UI interface.
When Salesforce is ready with the download URL, you can download the logs directly from the app:
The rest of the process remains the same – you need to upload the logs to your visualization tool of choice (Package Visualizer prompts you to use CRM Analytics, but unfortunately, it doesn’t upload and configure it automatically) and visualize.
How is this better than using the fully manual approach with Workbench I showed you earlier? You can install Package Visualizer on your Partner Business Org and request logs directly from there. Moreover, the app shows you some basic information about your package and includes a great additional feature (not strictly related to App Analytics, but still very useful for ISVs) – it allows you to manage push upgrades of your apps.
In conclusion, this approach is perfect if you just want to check whether anybody is using your app from time to time. However, it is still a manual process that doesn’t offer any built-in visualization options, so it’s only applicable for very simple use cases.
Use a Powerful Paid (or Freemium) Solution That Does Everything for You
The last option I’ll discuss here is using a paid solution that handles the entire process and visualizes the App Analytics data for you – you’re responsible only for opening the app and drawing strategic conclusions for your product.
Spoiler alert: if you’ve published your package for free and don’t want to spend money on such an app, don’t worry! I will suggest a free version of this kind of app below.
We have built such an app – ISV Analytics. It is designed for both Salesforce OEM and ISV Partners and includes a free plan for partners distributing only free apps. Similar to Package Visualizer, it can be installed directly on your Partner Business Org. You can find it here.
It manages the log collection process behind the scenes and provides access to multiple App Analytics dashboards. Here are some examples of the data we visualize out of the box:
A few screenshots that might encourage you to try it out:
OK, enough of this self-promotion, let’s get back to the objective pros and cons of this approach.
The undeniable advantage of this option is that you get a plug-and-play solution with no development effort on your side.
However, if you have very unique needs and the app doesn’t satisfy them, building your own automations might be a better choice.
App Analytics In Practice – Approach Comparison
Conclusion
Salesforce AppExchange App Analytics can provide invaluable insights into your AppExchange app’s usage and performance. Combine it with Marketplace Analytics, and you’ll be well-equipped to make strategic product decisions, drive growth, prevent churn, and enhance marketing activities.
Using it in practice might be challenging due to the number of manual actions required, but there are ready-to-go solutions that can help, as well as the possibility to automate the process yourself.
If you need help configuring App Analytics for your app or have follow-up questions about this post, don’t hesitate to contact me (https://www.linkedin.com/in/bartosz-suchocki) or Beyond The Cloud via email (contact@beyondthecloud.dev) or LinkedIn (https://linkedin.com/company/beyondtheclouddev).