tracking

package
v0.0.0-...-a7d12ec Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Event

func Event(r *http.Request, name string, meta map[string]string, tags map[string]string)

Event tracks an event. Metadata and tags are optional. The request is made in the backend, so that the visitor doesn't have to wait for it to complete.

func EventFromJSON

func EventFromJSON(w http.ResponseWriter, r *http.Request)

EventFromJSON tracks JavaScript using the API. The data is contained inside the body as JSON. The benefit over using the JavaScript snippet directly is that the backend serves as a proxy. Events tracked like this won't be blocked by ad blockers, as this is a first-party request (from your site to your site).

func EventFromURL

func EventFromURL(next http.HandlerFunc) http.HandlerFunc

EventFromURL returns a middleware tracking events using special URL parameters. These can be p_event for the event name, p_meta_<key> for metadata, p_path for the path the event was triggered on. p_event must be set. Plus characters will be replaced with a slash for the values, except for the path.

func Init

func Init()

Init sets up server-side tracking if the client secret is configured.

func PageView

func PageView(r *http.Request, tags map[string]string)

PageView tracks a page view. Tags are optional. The request is made in the backend, so that the visitor doesn't have to wait for it to complete.

Types

This section is empty.

Jump to

Keyboard shortcuts

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