BentoSdk.Stats (BentoSDK v0.1.0)
View SourceFunctions for retrieving statistics from Bento.
The Stats API allows you to:
- Get site statistics
- Get segment statistics
- Get report statistics
These statistics provide insights into your Bento account's performance.
Summary
Functions
Get report statistics.
Returns data for a specific report.
Parameters
report_id
- The ID of the report to get data for
Examples
iex> BentoSdk.Stats.get_report("456")
{:ok, %{
"report_data" => %{
"data" => %{},
"chart_style" => "count",
"report_type" => "Reporting::Reports::VisitorCountReport",
"report_name" => "New Subscribers"
}
}}
Get segment statistics.
Returns statistics for a specific segment.
Parameters
segment_id
- The ID of the segment to get statistics for
Examples
iex> BentoSdk.Stats.get_segment("123")
{:ok, %{
"user_count" => 500,
"subscriber_count" => 400,
"unsubscriber_count" => 100
}}
Get site statistics.
Returns basic statistics about your Bento site.
Examples
iex> BentoSdk.Stats.get_site()
{:ok, %{
"user_count" => 1000,
"subscriber_count" => 800,
"unsubscriber_count" => 200
}}