API Reference Pixelex v#0.1.0

Copy Markdown View Source

Modules

Cookieless, multi-tenant, first-party analytics for Phoenix.

Where a visitor came from, worked out rather than declared.

The query parameters ad platforms append to a destination URL, and what each one means.

Every knob, with its default and the reason the default is what it is.

Whether this visitor may be tracked at all, and by which layer.

The dashboard: traffic, sources, pages, devices, events and a funnel builder, in one LiveView.

Send one conversion to one ad platform.

One call, every ad platform a site has configured.

GA4 Measurement Protocol, server-side.

The one HTTP call every destination makes, and the reasoning behind each of its three options.

SHA-256 of normalised personal data, per each platform's own rules.

LinkedIn Conversions API.

Meta Conversions API.

Pinterest Conversions API (REST v5).

Reddit Conversions API v3.

Snapchat Conversions API (v3), server-side.

TikTok Events API (v1.3), server-side.

Delivers one conversion to every platform a site has configured.

What the server already knows about a request, extracted.

The one thing pixelex stores.

Who a visitor is, without storing anything on their device.

Today's hashing salt and yesterday's, cached in ETS.

The write path. Accumulate in memory, flush in batches, drop under pressure.

Page views from a LiveView, including the ones a page reload never happens for.

Schema, installed from a migration in the host application

Monthly partitions for pixelex_events: create them ahead of time, drop them when they age out.

One event, from a request context to the ingest buffer.

Count page views from the server. No JavaScript, nothing to block.

A Plug.Conn turned into a pipeline context.

Read a cookie without caring whether the host fetched them.

The browser's way in: POST /px/e and GET /px.gif.

Carry what only the HTTP request knows into the LiveView socket.

Reading the event log: traffic, funnels, retention, cohorts.

How many people made it from the first step to the last, and where the rest stopped.

A closed-open time window, from <= occurred_at < to.

Of the people who first appeared in week 0, how many came back in week 1, week 2, week 3.

Who came, from where, on what, and to which pages.

A fixed-window counter in ETS. Enough to bound an open endpoint, and no more.

Router macros for the ingest endpoint and the dashboard.

Sessions in ETS: thirty minutes of inactivity ends one.

Per-tenant configuration, cached in ETS.

Where events go.

An in-memory store. For tests, and for a dev server that should boot without a database.

Owns the ETS table so it outlives the process that first wrote to it.

The real store: the host application's own Postgres, and nothing else.

Mix Tasks

Minify assets/pixelex.js into priv/static/pixelex.js and write its SRI hash.

Generate the migration and print the wiring for this application.