# Data Sync Considerations

> Learn about data sync, usage logs, and limitations in ISV Analytics. Understand daily data synchronization, historical data load, and CRM Analytics limits.

# Data Sync Considerations

The _ISV Analytics_ app consolidates your app licensing data with the App Analytics logs collected by Salesforce. To avoid overloading your Salesforce instance, we synchronize this data at specific intervals.

## Daily App Usage Logs Collection

We request your package usage data from Salesforce once a day. We request detailed and granular [Package Usage Logs](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_custom_object_logs.htm), which are collected by Salesforce for your app after you enable app analytics (this is done as a [configuration step](./setup/app-setup.mdx) after installing _ISV Analytics_). We then aggregate these logs so that you don't waste data rows unnecessarily and join them with your app licensing data.

Salesforce collects logs from your customer instances worldwide, which takes time - typically **up to 2 days**. Therefore, there might be a **one to three days delay** between the moment an interaction occurs and when you see it on the dashboards.

More details about how Salesforce manages log collection from all instances can be found in the [official documentation article](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_data_flow.htm).

## Daily Data Recalculation

While we collect usage data daily, we also aggregate it and combine it with your app licensing data once a day. However, you also have the option to trigger recalculation manually from the dashboards, such as the `Subscribers Overview` dashboard.

![Dashboard Data Recalculation](img/dashboard-data-recalculation.png)

If a customer installs your app at 8 am, the related license will be automatically available on the dashboard the next day. You can use the `Recalculate` button on the dashboard to synchronize it instantly (_or rather almost instantly, as the recalculation also takes some time - between 5 minutes and a few hours depending on your app usage data volume_).

## Historical Data Load Considerations

We base the historical data load on the [Package Usage Summary](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_managed_package_usage_summaries.htm) logs collected by Salesforce. Salesforce retains these logs for a very long time (10 years) compared to other types of logs (_Package Usage Logs_ and _Subscriber Snapshots_ are kept only for 45 days due to their granular data). Their collection is enabled from the moment you publish your app on AppExchange, making them perfect for loading historical data.

However, there are certain limitations related to using these logs.

### Historical Data Load Current Month Data Gap

Since the [Package Usage Summary](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_managed_package_usage_summaries.htm) logs contain monthly summaries of your app's usage, they **can only be requested for full months in the past**. If you request the historical data load right after installing the package, a **historical data gap** will occur for the current month. Here’s an example:

1. You installed the app on August 20th.
2. As part of the [configuration steps](./setup/app-setup.mdx), you enabled the App Usage Logs collection for your package.
3. The daily usage logs sync by _ISV Analytics_ starts collecting usage data from that moment (August 20th).
4. You used our historical data load functionality to import usage data from the last 3 months.
5. Summary logs operate on full months, so the logs from May, June, and July are loaded.
6. Where is the data from August 1st to August 20th? This is the data gap.

Fortunately, you won’t experience this data gap for long—the _ISV Analytics_ app will re-request summary data for the gapped period automatically at the beginning of the next month (on the second day).

### Historical Data Source Org Types Considerations

The [Package Usage Summary](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_managed_package_usage_summaries.htm) logs are retained by Salesforce for a very long time. Thanks to that, even if you released your app a few years ago and have just installed the _ISV Analytics_ app, you can still load and visualize this data. But as with all great things, there are some limitations involved.

To avoid overloading itself with massive data loads, **Salesforce collects the _Package Usage Summary_ logs only for active production orgs**. This means that if your customer was using your app on a sandbox or trial org before you installed _ISV Analytics_, you will not see this data.

Our regular, everyday data collection jobs will collect data from more org types than the historical data load. The everyday requested [Package Usage Logs](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_managed_package_log_files.htm) are collected for all types of orgs, except for _scratch orgs_. As a result, on our dashboards **you might see more interactions with your app after the _ISV Analytics_ app installation date compared to the historical usage**.

To learn more about what data is collected for different types of logs, you can refer to the [official Salesforce documentation](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_download_mp_logs.htm).

### Historical Data Granularity

The [Package Usage Summary](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_managed_package_usage_summaries.htm) logs store less granular data than the [Package Usage Logs](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_managed_package_log_files.htm) we collect every day from the _ISV Analytics_ app installation.
Because of that, you will not be able to see the following values on the _ISV Analytics_ dashboards and tables for the data loaded via the historical data load:

- Organization Country Code
- User Country Code

## Resources

- [AppExchange App Analytics - Salesforce Documentation](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_intro_2gp.htm)
- [Package Usage Summary Logs - Salesforce Documentation](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_managed_package_usage_summaries.htm)
- [Package Usage Logs - Salesforce Documentation](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_managed_package_log_files.htm)
- [What data is collected for different log types - Salesforce article](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/app_analytics_download_mp_logs.htm)
