Working with subscriptions statistics

The subscription statistics provide statistics about the count of the subscriptions in the email campaigns module. They can be used to provide information like:

  • Total count of subscriptions and canceled subscriptions;
  • Total count of subscriptions and canceled subscriptions for the last week or the last month;
  • Total count of subscriptions and canceled subscriptions for today;

This topic explains how to obtain these statistics and how to work with them in order to visualize a specific infromation.

Querying subscriptions statistics

To query the subscriptions statistics, you must get all the subscribers in the email campaigns module and filter them according to the desired criteria. For more information on how to get all the subscribers, see Querying subscribers.

The Native API exposes methods that upon calling automatically calculate one of the following statistics for you:

 

  • The count of new subscriptions this month;
  • The count of new subscriptions this week;
  • The count of new subscriptions today;
  • The total count of subscriptions;
  • The count of cnaceled subscriptions this month;
  • The count of canceled subscriptions this week;
  • The count of canceled subscriptions today;

 

To obtain these statistics, you must call the respective methods of the NewsletterManager class:

 

public void ExecuteSubscriptionsStatsCalculations()
{
    NewslettersManager manager = NewslettersManager.GetManager();
 
    int totalSubscriptionsMonth = manager.CalculateNewSubscriptionsThisMonth();
 
    int totalSubscriptionsWeek = manager.CalculateNewSubscriptionsThisWeek();
 
    int totalSubscriptionsToday = manager.CalculateNewSubscriptionsToday();
 
    int totalSubscriptions = manager.CalculateTotalNumberOfSubscriptions();
 
    int totalUnsubscriptionsMonth = manager.CalculateUnsubscriptionsThisMonth();
 
    int totalUnsubscriptionsWeek = manager.CalculateUnsubscriptionsThisWeek();
 
    int totalUnsubscriptionsToday = manager.CalculateUnsubscriptionsToday();
}

 

Next steps

+1-888-365-2779
sales@sitefinity.com

Related topics:

Feedback

How useful is this article?

Tell us more

Submit
Your message was successfully sent.

We appreciate your feedback.

Your message could not be sent.

OK