View Source Plausible.Props (Plausible v0.0.1)

Context module for handling custom event props.

Summary

Functions

Allows a prop key or a list of props keys to be included in ClickHouse queries. Allowing prop keys does not affect ingestion, as we don't want any data to be dropped or lost.

Allows the 300 most frequent props keys for a specific site over the past 6 months.

Returns whether the site has configured custom props or not.

Removes a previously allowed prop key from the allow list. This means this prop key won't be included in ClickHouse queries. This doesn't drop any ClickHouse data, nor affects ingestion.

Lists prop keys used internally.

Queries the events table to fetch the 300 most frequent prop keys for a specific site over the past 6 months, excluding keys that are already allowed.

Types

Functions

Link to this function

allow(site, prop_or_props)

View Source
@spec allow(Plausible.Site.t(), [prop()] | prop()) ::
  {:ok, Plausible.Site.t()}
  | {:error, Ecto.Changeset.t()}
  | {:error, :upgrade_required}

Allows a prop key or a list of props keys to be included in ClickHouse queries. Allowing prop keys does not affect ingestion, as we don't want any data to be dropped or lost.

Link to this function

allow_changeset(site, prop_or_props)

View Source
Link to this function

allow_existing_props(site)

View Source
@spec allow_existing_props(Plausible.Site.t()) ::
  {:ok, Plausible.Site.t()} | {:error, :upgrade_required}

Allows the 300 most frequent props keys for a specific site over the past 6 months.

Returns whether the site has configured custom props or not.

@spec disallow(Plausible.Site.t(), prop()) ::
  {:ok, Plausible.Site.t()} | {:error, Ecto.Changeset.t()}

Removes a previously allowed prop key from the allow list. This means this prop key won't be included in ClickHouse queries. This doesn't drop any ClickHouse data, nor affects ingestion.

Lists prop keys used internally.

These props should be allowed by default, and should not be displayed in the props settings page. For example, url is a special prop key used for file downloads and outbound links. It doesn't make sense to remove this prop key from the allow list, or to suggest users to add this prop key.

Link to this function

suggest_keys_to_allow(site, limit \\ 300)

View Source
@spec suggest_keys_to_allow(Plausible.Site.t(), non_neg_integer()) :: [String.t()]

Queries the events table to fetch the 300 most frequent prop keys for a specific site over the past 6 months, excluding keys that are already allowed.