View Source Plausible.Stats.Goal.Revenue (Plausible v0.0.1)

Revenue specific functions for the stats scope

Summary

Functions

Returns the common currency for the goal filters in a query. If there are no goal filters, multiple currencies or the site owner does not have access to revenue goals, nil is returned and revenue metrics are dropped.

Functions

Link to this function

cast_revenue_metrics_to_money(results, revenue_goals)

View Source
Link to this function

get_revenue_tracking_currency(site, query, metrics)

View Source
@spec get_revenue_tracking_currency(Plausible.Site.t(), Plausible.Stats.Query.t(), [
  atom()
]) ::
  {atom() | nil, [atom()]}

Returns the common currency for the goal filters in a query. If there are no goal filters, multiple currencies or the site owner does not have access to revenue goals, nil is returned and revenue metrics are dropped.

Aggregating revenue data works only for same currency goals. If the query is filtered by goals with different currencies, for example, one USD and other EUR, revenue metrics are dropped.