HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback


The collect data feature provides raw data for created subsctions and includes the ability to specify time periods, and scheduled jobs to collect different types of Optimizely Customized Commerce data. The collected data is made available under the Reports tab in the Commerce user interface.

See [Collect data for reports](🔗) for information about data collection for reports.

## Collect subscription data

A [subscription](🔗) allows for recurring orders, and for payments to be spread over time, providing flexibility in how you sell your products. The **Export subscription data** feature lets you collect and export subscription-based data to be consumed by other applications.

### Set time range for the report

You determine the time range for the reports in the web.config file, under <appSettings>.



Values are numbers of days prior to the date that you run the **Collect Reporting Subscription** scheduled job. Begin and end dates are included in the subscription dates. For each value, the job creates one corresponding CSV file.

The above example means that the Collect Reporting Subscription scheduled job generates four CSV files: one for all subscriptions created within the last _30_ days, another for subscriptions created within the last _60_ days, and so on. Each CSV file is compressed into a .zip file.

In this example the report compiles one report containing subscriptions data for the past year (365 days).



Note

If the web.config has no settings for episerver:commerce.SubscriptionTimeRangesInDays, the default value is 90.

### Collect Reporting Subscription scheduled job

The scheduled job **Collect Reporting Subscription** collects subscription data in the background. Like other scheduled jobs, you can run this manually or at predetermined time intervals.



### Subscription data

This version provides the following information for each subscription created during the specified time range in LineItem level.

  • LineItemID

  • LineItemCode

  • DisplayName

  • PlacedPrice

  • Quantity

  • ExtendedPrice

  • EntryDiscountAmount: The line item's discount amount

  • SalesTax

  • Currency

  • SubscriptionId

  • Subscription Status

  • CustomerID

  • CustomerName

  • MarketId

  • Cycle Mode

  • Cycle Length

  • Max Cycles Count

  • Completed Cycles Count

  • Is Active

  • Start Date

  • End Date

  • Last Transaction Date

  • Total Revenue - revenue of all orders completed by subscription

### Access the data

After collecting the report data, a link to the exported .zip files appears under **Reports**. Click the link to download the data. Collected report data is presented in a comma-separated value (CSV) format.



**Related blog post:** [Implementing a custom reporting service for Commerce](🔗)