Area: Optimizely Commerce
Applies to versions: Commerce 13.28 and higher

Collecting subscription data

Recommended reading 

This topic describes how to collect and access data for subscription reports in Optimizely Commerce.

How it works

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 Commerce data. The collected data is made available under the Reports tab in the Commerce user interface.

See Collecting data for reports for more information about data collection for reports.

Collecting 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. 

Setting time range for the report

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

<add key="episerver:commerce.SubscriptionTimeRangesInDays" value="30;60;90;120"/>

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 in a .zip file.

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

<add key="episerver:commerce.SubscriptionTimeRangesInDays" value="365" />

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

The 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

    Accessing 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 topics

    Do you find this information helpful? Please log in to provide feedback.

    Last updated: Jan 15, 2021

    Recommended reading