View Source Plausible.Imported.UniversalAnalytics (Plausible v0.0.1)

Import implementation for Universal Analytics.

Summary

Functions

Imports stats from a Google Analytics UA view to a Plausible site.

Types

@type import_opt() ::
  {:view_id, non_neg_integer()}
  | {:date_range, Date.Range.t()}
  | {:auth, {String.t(), String.t(), String.t()}}
@type job_opt() ::
  {:view_id, non_neg_integer()}
  | {:start_date
     | :end_date
     | :access_token
     | :refresh_token
     | :token_expires_at, String.t()}

Functions

@spec create_job(Plausible.Site.t(), [job_opt()]) :: Ecto.Changeset.t()
Link to this function

from_report(data, site_id, table)

View Source
@spec import(Plausible.Site.t(), [import_opt()]) :: :ok | {:error, any()}

Imports stats from a Google Analytics UA view to a Plausible site.

This function fetches Google Analytics reports which are then passed in batches to Clickhouse by the Plausible.Imported.Buffer process.

@spec name() :: String.t()
@spec parse_args(map()) :: [import_opt()]