View Source Plausible.Site (Plausible v0.0.1)

Site schema

Summary

Types

@type t() :: %Plausible.Site{
  __meta__: term(),
  allowed_event_props: term(),
  conversions_enabled: term(),
  custom_domain: term(),
  domain: term(),
  domain_changed_at: term(),
  domain_changed_from: term(),
  entry_type: term(),
  from_cache?: term(),
  funnels_enabled: term(),
  goals: term(),
  google_auth: term(),
  id: term(),
  imported_data: term(),
  ingest_rate_limit_scale_seconds: term(),
  ingest_rate_limit_threshold: term(),
  inserted_at: term(),
  invitations: term(),
  locked: term(),
  members: term(),
  memberships: term(),
  monthly_report: term(),
  native_stats_start_at: term(),
  owner: term(),
  ownership: term(),
  pinned_at: term(),
  props_enabled: term(),
  public: term(),
  revenue_goals: term(),
  spike_notification: term(),
  stats_start_date: term(),
  timezone: term(),
  updated_at: term(),
  weekly_report: term()
}

Functions

Link to this function

changeset(site, attrs \\ %{})

View Source
Link to this function

crm_changeset(site, attrs)

View Source

Returns the date of the first recorded stat in the timezone configured by the user. This function does 2 transformations: UTC %NaiveDateTime{} -> Local %DateTime{} -> Local %Date

Examples

iex> Plausible.Site.local_start_date(%Plausible.Site{stats_start_date: nil}) nil

iex> utc_start = ~N[2022-09-28 00:00:00] iex> tz = "Europe/Helsinki" iex> site = %Plausible.Site{stats_start_date: utc_start, timezone: tz} iex> Plausible.Site.local_start_date(site) ~D[2022-09-28]

iex> utc_start = ~N[2022-09-28 00:00:00] iex> tz = "America/Los_Angeles" iex> site = %Plausible.Site{stats_start_date: utc_start, timezone: tz} iex> Plausible.Site.local_start_date(site) ~D[2022-09-27]

Link to this function

remove_imported_data(site)

View Source
Link to this function

set_imported_source(site, imported_source)

View Source
Link to this function

set_native_stats_start_at(site, val)

View Source
Link to this function

set_stats_start_date(site, val)

View Source
Link to this function

start_import(site, start_date, end_date, imported_source, status \\ "importing")

View Source
Link to this function

tz_offset(site, utc_now \\ DateTime.utc_now())

View Source
Link to this function

update_changeset(site, attrs \\ %{}, opts \\ [])

View Source