Skip to content

Decorator Usage

@track

...

PARAMETER DESCRIPTION REQUIRED
event (string) The text of the event you'd like to send
event_data (UmamiEventData) The data of the event

Example

import django_umami.decorators

@django_umami.decorators.track("Someone called my function!")
def myview(...)
    ...

Blah

PARAMETER DESCRIPTION REQUIRED
event (UmamiEventData) The data of the event

Example

import django_umami.decorators

@django_umami.decorators.track({"name": "Someone called my view!"})
def myview(...)
@track_visit

This will automatically fill in details about your view, e.g. URL Path, Referrer and Page Title. You can override any values needed though!

PARAMETER DESCRIPTION REQUIRED
event_data (UmamiEventData) The data of the event

Example

import django_umami.decorators

@django_umami.decorators.track_visit()
def myview(...)