Show your Clearstream account usage within Rock.

Why

If you have sub-accounts in Clearstream, there is not a convenient way to see your account usage across all of your sub-accounts. This dashboard will show you the usage of all your sub-accounts in one place.

CLearstream Dashboard

Dashboard Features

  • View current billing cycle: Quickly see your current billing cycle usage, how many credits you have remaining in your plan, plus how many non-expiring credits you have available.
  • See all sub-accounts: See total number of messages sent, received, and opt-ins/opt-out aggregate across all sub-accounts.
  • Custom Date Ranges: Select a custom date range to see usage for that period, rather than just the current billing cycle. Useful for seeing how much you've used in the past month, quarter, etc. to help you have better visibility across your sub-accounts and better plan your Clearstream plan according to their expiring 'credit' system.
  • Per-Account KPIs: See key performance indicators like number of messages sent/recieved, opt-in rate, opt-out rate, and subscriber count.
  • Per-account usage graph: See a graph of messages sent and received over time for each sub-account.

Configuration

  1. Create an API key in Clearstream. Create API Key.
    IMPORTANT: THE API KEY MUST BE CREATED BY THE ACCOUNT OWNER AND HAVE ACCESS TO ALL SUB-ACCOUNTS
  2. Create a new Page in Rock. I named it 'Clearstream Dashboard' and put it in the 'Communications' section
  3. Add Page Parameter Filter block to the page to customize the date range.
    CLearstream Dashboard
  4. Configure the Page Parameter Filter block to filter the dashboard by the date range. Set the 'Selection Action' to Update Page. Then add the following filters:
    CLearstream Dashboard
  5. Add a new filter for toggling between the current billing cycle and a custom date range. Field Type: Boolean. Set the Key to UseCustomDateRange
    CLearstream Dashboard
  6. Add a Date Range filter for selecting the custom date range. Field Type: Sliding Date Range. Make the Key SlidingDateRange. Set a default value for the date range, if you want.
    CLearstream Dashboard
  7. Add Filter for Date detail to show on graph. Field Type: Single-Select. Set the Key to GroupBy. Add the following options: Day,Month. Set the default value to Day.
    CLearstream Dashboard
  8. Add HTML block to the page to display the dashboard.
    - Paste in the Code from the Gist.
    - On line 6, replace YOUR_API_KEY_HERE with the API key you created in step 1.
    - On line 7, leave main in the list and replace the other NUMBERS with your sub-account numbers from Clearstream. You can find these in the URL when you are viewing the account in Clearstream, or in the Clearstream dashboard. UPDATE 8/7/24: No longer need to manually enter your account IDs. It now pulls in all of your sub-accounts automatically from the undocumented /accounts endpoint.

This should be all you need to get the dashboard up and running. If you have any questions or need help, feel free to reach out to me on Rocket Chat.

CHANGELOG:

Code revisions can be seen here.
Updated 8/7/24 to remove the need to manually enter your sub-account numbers.