ref

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package ref normalizes referrer URLs and assigns a coarse traffic channel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel string

Channel is a coarse acquisition label for analytics rollups.

const (
	ChannelDirect   Channel = "direct"
	ChannelOrganic  Channel = "organic"
	ChannelSocial   Channel = "social"
	ChannelEmail    Channel = "email"
	ChannelReferral Channel = "referral"
)

type Info

type Info struct {
	Referrer string
	Channel  Channel
	Source   string // display label, e.g. Google, Facebook
}

Info is the parsed referrer used when storing hits.

func Parse

func Parse(referrer, siteHost string) Info

Parse normalizes referrer for the given site host and classifies the channel.

Jump to

Keyboard shortcuts

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