API Reference GoodAnalytics v#0.1.1

Copy Markdown View Source

Modules

Visitor intelligence, link tracking, source attribution, and behavioral analytics for Phoenix.

Read-analytics endpoints over the consolidated core read layer (GoodAnalytics.Core.Audience and GoodAnalytics.Core.Analytics).

Authenticates API requests via a host-app-provided callback.

Workspace-scoped REST endpoints for recording server-side events.

Workspace-scoped REST endpoints for managing tracked links.

Workspace-scoped REST endpoints for referral partner management.

Plug that records API requests as api_request events.

REST API router for server-side event tracking, link management, and visitor queries.

Headline KPIs for a window: visitor/pageview/revenue counts, identification rate, and session-grain rates. Backed by GoodAnalytics.Core.Analytics.kpis/2.

Attribution details for a visitor.

Request body for submitting multiple server-side events.

Per-event results from a batch event submission.

Audience breakdown response: the echoed dimension plus the metric rows.

One dimension bucket with its metric values.

Link click event resource returned by the API.

Standard API error response body.

Request body for recording a single server-side event.

Success response for a recorded event. Returns the persisted event_id.

Request body for creating a tracked link.

Full tracked-link resource returned by the API.

Aggregated performance metrics for a link.

Request body for partially updating a tracked link.

Shared pagination query parameters.

Request body for creating a referral partner.

Full referral partner resource returned by the API.

Request body for updating a referral partner. All fields optional.

Single event entry in a visitor timeline.

One zero-filled, timezone-aligned bucket.

Timeseries response: echoed metric + interval label + points.

Full visitor resource returned by the API.

Workspace-scoped REST endpoints for visitor lookup and inspection.

OpenAPI specification for GoodAnalytics.

Router that serves OpenAPI spec JSON and Swagger UI.

Two-tier API key authentication.

Nebulex cache for click deduplication and settings caching.

Google Ads offline conversions connector adapter.

LinkedIn Conversions API connector adapter.

Meta Conversions API (CAPI) connector adapter.

TikTok Events API connector adapter.

Compile-time and runtime configuration for the connector subsystem.

Behavior contract for outbound connectors.

Connector dispatch delivery engine.

Durable outbound connector dispatch record.

Context for connector dispatch record operations.

Derives stable connector event IDs deterministically.

Workspace-scoped mapping from a custom GoodAnalytics event to a connector event.

Context for workspace-scoped custom event connector mappings.

Behaviour-based HTTP adapter for connector delivery.

Req-based HTTP adapter for connector delivery.

Evaluates enabled connectors for an event and creates dispatch records.

Post-commit connector dispatch creation.

Default flow runner for post-commit connector dispatch.

Replays failed connector dispatches from stored source context.

Connector setting keys and configuration helpers.

Shared signal normalization layer for connector identifiers.

Telemetry event definitions for the connector subsystem.

Aggregate read surface over the library-managed good_analytics event/visitor/session tables.

One shared, tested audience-breakdown query surface for every consumer.

Context for event queries.

Runtime API for backfilling event-grain device columns from stored user agents.

Unified event stream record.

Records events into the unified event stream.

URL normalization helpers for analytics grouping.

Context for funnel definition CRUD and analysis.

Embedded schema for funnel cohort source filtering.

Embedded schema for a funnel step filter.

Funnel definition entity.

Builds funnel analysis SQL queries.

Embedded schema for a funnel step.

Resolves incoming tracking signals to a single visitor record.

Context for link CRUD operations.

Short links, referral links, and campaign links.

Generates QR code images for short links.

Phoenix controller that serves QR code images for short links.

Handles short link redirects.

Phoenix router for short link domain redirects.

Slug generation for short links.

Context for partner CRUD operations.

Shared referral partner attribution logic.

Core-owned referral partner identity.

Server-side sessionization context.

Acquisition-change boundary rule for sessionization.

Runtime API for backfilling historical sessions.

Optional in-memory fast path for live-session lookup.

Aggregated visitor session record.

Pure per-event session field computation.

Handles beacon POSTs from the JS client and client-side click tracking.

IP-based click deduplication.

Serves GoodAnalytics JS snippet files from priv/static/js.

Phoenix Plug for server-side tracking.

Signs, verifies, and manages the _ga_ref referral attribution cookie.

Phoenix router for client-side tracking endpoints.

Generates social share URLs for all major platforms.

Classifies the source of an inbound request.

Context for visitor CRUD and lifecycle operations.

The central identity graph record.

User-agent intelligence for GoodAnalytics, wrapping :ua_inspector.

Custom short link domains.

pgflow Flow for immediate connector dispatch delivery.

pgflow Flow that plans connector dispatches after the source event commits.

pgflow Flow that reconciles missing connector dispatches.

pgflow Flow that creates monthly partitions for ga_events.

Facade for IP → geo lookup.

Starts and supervises the configured locus loader.

Locus-backed provider for GoodAnalytics.Geo.

Behaviour for translating provider-specific lookup results into the canonical geo map stored in ga_visitors.geo.

Normalizes MaxMind GeoLite2-City / GeoIP2-City result maps into the canonical GoodAnalytics.Geo.Normalizer.normalized shape.

Behaviour for GeoIP providers.

Event hooks for downstream consumers.

Small map helpers used across the library.

Manages database migrations for GoodAnalytics tables.

Initial GoodAnalytics schema — creates all core tables.

Connector dispatch persistence and signal columns.

Rename customer_* columns on ga_visitors to person_*.

Add composite indexes for workspace-scoped link/event and visitor first-click lookups.

Add ga_funnels table for workspace-scoped funnel definitions.

Add api_request to the chk_event_type constraint.

Add host and path columns with indexes to ga_events.

Add Core referral partner schema and partner attribution columns.

Add event-grain device columns and breakdown indexes to ga_events.

Add the ga_sessions table and ga_events.session_id.

Add per-dimension composite indexes to ga_sessions for session-grain audience breakdowns (device_type, browser, os, source_platform, source_medium, source_campaign), mirroring the ga_events dimension indexes from v04/v09.

Add a workspace-leading partial index on ga_events for per-session path aggregation.

Add workspace-scoped custom event connector mappings.

Manages monthly partition creation for ga_events.

Provides access to the host application's Ecto repo.

Generic SQL helpers shared across the library (and host apps that build their own queries against the GoodAnalytics tables).

Per-workspace runtime settings with Nebulex caching.

Per-workspace runtime settings.

Time window helpers built around half-open ranges.

Mix Tasks

Local convenience wrapper for the temporary event device backfill.

Local convenience wrapper for the temporary session backfill.

Generates an Ecto migration to apply pending GoodAnalytics schema changes.

Generates an Ecto migration that sets up GoodAnalytics tables.