View Source Plausible.Goals (Plausible v0.0.1)

Summary

Functions

Link to this function

batch_create_event_goals(names, site)

View Source
@spec count(Plausible.Site.t()) :: non_neg_integer()
Link to this function

create(site, params, opts \\ [])

View Source
@spec create(Plausible.Site.t(), map(), Keyword.t()) ::
  {:ok, Plausible.Goal.t()}
  | {:error, Ecto.Changeset.t()}
  | {:error, :upgrade_required}

Creates a Goal for a site.

If the created goal is a revenue goal, it sets site.updated_at to be refreshed by the sites cache, as revenue goals are used during ingestion.

@spec create_404(Plausible.Site.t()) :: :ok
Link to this function

create_file_downloads(site)

View Source
@spec create_file_downloads(Plausible.Site.t()) :: :ok
Link to this function

create_outbound_links(site)

View Source
@spec create_outbound_links(Plausible.Site.t()) :: :ok

If a goal belongs to funnel(s), we need to inspect their number of steps.

If it exceeds the minimum allowed (defined via Plausible.Funnel.min_steps/0), the funnel will be reduced (i.e. a step associated with the goal to be deleted is removed), so that the minimum number of steps is preserved. This is done implicitly, by postgres, as per on_delete: :delete_all.

Otherwise, for associated funnel(s) consisting of minimum number steps only, funnel record(s) are removed completely along with the targeted goal.

@spec delete_404(Plausible.Site.t()) :: :ok
Link to this function

delete_file_downloads(site)

View Source
@spec delete_file_downloads(Plausible.Site.t()) :: :ok
Link to this function

delete_outbound_links(site)

View Source
@spec delete_outbound_links(Plausible.Site.t()) :: :ok
Link to this function

find_or_create(site, params)

View Source
Link to this function

for_site(site, opts \\ [])

View Source
Link to this function

for_site_query(site, opts \\ [])

View Source
@spec get(Plausible.Site.t(), pos_integer()) :: nil | Plausible.Goal.t()
Link to this function

list_revenue_goals(site)

View Source
@spec update(Plausible.Goal.t(), map()) ::
  {:ok, Plausible.Goal.t()}
  | {:error, Ecto.Changeset.t()}
  | {:error, :upgrade_required}