Help us shape the future of Go! Take the 2026 Go Developer Survey

analytics

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package analytics computes the dashboard's Overview: contacts, Engagement rates, automations and the daily time series (GLOSSARY "Engagement rates").

Engagement rates are a send cohort: the denominator is the Broadcast recipients sent in the window, and opens and clicks are counted among that same cohort, so opened never exceeds sent and every rate is within [0, 1]. They are not the Sending-domain Complaint and Bounce rates of internal/reputation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Automations

type Automations struct {
	Total, Active, RunsActive, RunsCompleted int
}

Automations is a point-in-time snapshot.

type Contacts

type Contacts struct {
	Total, Active, Unsubscribed, NewInWindow int
}

Contacts: Unsubscribed is "globally non-mailable" (ADR 0001), Active the remainder.

type Email

type Email struct {
	Sent, Opened, Clicked                int
	OpenRate, ClickRate, ClickToOpenRate float32
}

Email is the send cohort's counts and Engagement rates.

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module computes Overviews. Its clock is time.Now.

func New

func New() *Module

func (*Module) Overview

func (m *Module) Overview(ctx context.Context, s *ent.Scoped, w Window) (*Overview, error)

Overview computes the dashboard for the Workspace behind s over the window.

type Overview

type Overview struct {
	Contacts    Contacts
	Email       Email
	Automations Automations
	Series      []Point
}

Overview is everything the dashboard shows for one Workspace and window.

type Point

type Point struct {
	Date                  string
	Sent, Opened, Clicked int
}

Point is one UTC day of the send cohort.

type Window

type Window int

Window is the selectable trailing window in UTC days, today included.

const (
	Window7Days  Window = 7
	Window30Days Window = 30
	Window90Days Window = 90
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL