View Source Plausible.Funnels (Plausible v0.0.1)

This module implements contextual Funnel interface, allowing listing, creating and deleting funnel definitions.

For brief explanation of what a Funnel is, please see Plausible.Funnel schema. See Plausible.Stats.Funnel for the evaluation logic.

Summary

Functions

Link to this function

create(site, name, steps)

View Source
@spec create(Plausible.Site.t(), String.t(), [map()]) ::
  {:ok, Plausible.Funnel.t()}
  | {:error, Ecto.Changeset.t() | :invalid_funnel_size | :upgrade_required}
Link to this function

create_changeset(site, name, steps)

View Source
@spec create_changeset(Plausible.Site.t(), String.t(), [map()]) :: Ecto.Changeset.t()
Link to this function

delete(site_id, funnel_id)

View Source
@spec delete(Plausible.Site.t() | pos_integer(), pos_integer()) :: :ok
Link to this function

edit_changeset(funnel, name, steps)

View Source
@spec edit_changeset(Plausible.Funnel.t(), String.t(), [map()]) :: Ecto.Changeset.t()
Link to this function

ephemeral_definition(site, name, steps)

View Source
@spec ephemeral_definition(Plausible.Site.t(), String.t(), [map()]) ::
  Plausible.Funnel.t()
@spec list(Plausible.Site.t()) :: [
  %{name: String.t(), id: pos_integer(), steps_count: pos_integer()}
]
Link to this function

update(funnel, name, steps)

View Source
@spec update(Plausible.Funnel.t(), String.t(), [map()]) ::
  {:ok, Plausible.Funnel.t()}
  | {:error, Ecto.Changeset.t() | :invalid_funnel_size | :upgrade_required}
@spec with_goals_query(Plausible.Site.t()) :: Ecto.Query.t()