# Pixelex v0.1.0 - Table of Contents

> Cookieless, multi-tenant, first-party analytics for Phoenix: web visitors, product events and ad-platform attribution over one event log.

## Pages

- [pixelex](readme.md)
- [Changelog](changelog.md)

## Modules

- [Pixelex.Query.Range](Pixelex.Query.Range.md): A closed-open time window, `from <= occurred_at < to`.
- [Pixelex.Store.ETS.Owner](Pixelex.Store.ETS.Owner.md): Owns the ETS table so it outlives the process that first wrote to it.

- Public API
  - [Pixelex](Pixelex.md): Cookieless, multi-tenant, first-party analytics for Phoenix.
  - [Pixelex.Config](Pixelex.Config.md): Every knob, with its default and the reason the default is what it is.
  - [Pixelex.Event](Pixelex.Event.md): The one thing pixelex stores.

- Capture
  - [Pixelex.LiveView](Pixelex.LiveView.md): Page views from a LiveView, including the ones a page reload never happens
for.
  - [Pixelex.Plug](Pixelex.Plug.md): Count page views from the server. No JavaScript, nothing to block.
  - [Pixelex.Plug.Context](Pixelex.Plug.Context.md): A `Plug.Conn` turned into a pipeline context.
  - [Pixelex.Plug.Cookies](Pixelex.Plug.Cookies.md): Read a cookie without caring whether the host fetched them.
  - [Pixelex.Plug.Ingest](Pixelex.Plug.Ingest.md): The browser's way in: `POST /px/e` and `GET /px.gif`.
  - [Pixelex.Plug.Session](Pixelex.Plug.Session.md): Carry what only the HTTP request knows into the LiveView socket.
  - [Pixelex.Router](Pixelex.Router.md): Router macros for the ingest endpoint and the dashboard.

- Identity
  - [Pixelex.Consent](Pixelex.Consent.md): Whether this visitor may be tracked at all, and by which layer.
  - [Pixelex.Identity](Pixelex.Identity.md): Who a visitor is, without storing anything on their device.
  - [Pixelex.Identity.Salts](Pixelex.Identity.Salts.md): Today's hashing salt and yesterday's, cached in ETS.
  - [Pixelex.Sessions](Pixelex.Sessions.md): Sessions in ETS: thirty minutes of inactivity ends one.

- Attribution
  - [Pixelex.Attribution](Pixelex.Attribution.md): Where a visitor came from, worked out rather than declared.
  - [Pixelex.Attribution.ClickIds](Pixelex.Attribution.ClickIds.md): The query parameters ad platforms append to a destination URL, and what each
one means.
  - [Pixelex.Enrich](Pixelex.Enrich.md): What the server already knows about a request, extracted.

- Ingest
  - [Pixelex.Ingest](Pixelex.Ingest.md): The write path. Accumulate in memory, flush in batches, drop under pressure.
  - [Pixelex.Pipeline](Pixelex.Pipeline.md): One event, from a request context to the ingest buffer.
  - [Pixelex.RateLimit](Pixelex.RateLimit.md): A fixed-window counter in ETS. Enough to bound an open endpoint, and no more.

- Storage
  - [Pixelex.Migration](Pixelex.Migration.md): Schema, installed from a migration in the host application
  - [Pixelex.Partitions](Pixelex.Partitions.md): Monthly partitions for `pixelex_events`: create them ahead of time, drop them
when they age out.
  - [Pixelex.Sites](Pixelex.Sites.md): Per-tenant configuration, cached in ETS.
  - [Pixelex.Store](Pixelex.Store.md): Where events go.
  - [Pixelex.Store.ETS](Pixelex.Store.ETS.md): An in-memory store. For tests, and for a dev server that should boot without
a database.
  - [Pixelex.Store.Postgres](Pixelex.Store.Postgres.md): The real store: the host application's own Postgres, and nothing else.

- Queries
  - [Pixelex.Query](Pixelex.Query.md): Reading the event log: traffic, funnels, retention, cohorts.
  - [Pixelex.Query.Funnel](Pixelex.Query.Funnel.md): How many people made it from the first step to the last, and where the rest
stopped.
  - [Pixelex.Query.Retention](Pixelex.Query.Retention.md): Of the people who first appeared in week 0, how many came back in week 1,
week 2, week 3.
  - [Pixelex.Query.Traffic](Pixelex.Query.Traffic.md): Who came, from where, on what, and to which pages.

- Ad platforms
  - [Pixelex.Destination](Pixelex.Destination.md): Send one conversion to one ad platform.
  - [Pixelex.Destinations](Pixelex.Destinations.md): One call, every ad platform a site has configured.
  - [Pixelex.Destinations.GA4](Pixelex.Destinations.GA4.md): GA4 Measurement Protocol, server-side.
  - [Pixelex.Destinations.HTTP](Pixelex.Destinations.HTTP.md): The one HTTP call every destination makes, and the reasoning behind each of
its three options.
  - [Pixelex.Destinations.Hash](Pixelex.Destinations.Hash.md): SHA-256 of normalised personal data, per each platform's own rules.
  - [Pixelex.Destinations.LinkedIn](Pixelex.Destinations.LinkedIn.md): LinkedIn Conversions API.
  - [Pixelex.Destinations.Meta](Pixelex.Destinations.Meta.md): Meta Conversions API.
  - [Pixelex.Destinations.Pinterest](Pixelex.Destinations.Pinterest.md): Pinterest Conversions API (REST v5).
  - [Pixelex.Destinations.Reddit](Pixelex.Destinations.Reddit.md): Reddit Conversions API v3.
  - [Pixelex.Destinations.Snapchat](Pixelex.Destinations.Snapchat.md): Snapchat Conversions API (v3), server-side.
  - [Pixelex.Destinations.TikTok](Pixelex.Destinations.TikTok.md): TikTok Events API (v1.3), server-side.
  - [Pixelex.Destinations.Worker](Pixelex.Destinations.Worker.md): Delivers one conversion to every platform a site has configured.

- Dashboard
  - [Pixelex.Dashboard.Live](Pixelex.Dashboard.Live.md): The dashboard: traffic, sources, pages, devices, events and a funnel
builder, in one LiveView.

## Mix Tasks

- [mix pixelex.build](Mix.Tasks.Pixelex.Build.md): Minify `assets/pixelex.js` into `priv/static/pixelex.js` and write its SRI hash.
- [mix pixelex.install](Mix.Tasks.Pixelex.Install.md): Generate the migration and print the wiring for this application.

