Skip to main content

Library to track user interactions in Dash applications

Project description

Dash Tracker

Dash Tracker is a lightweight tracking library for Dash applications. It logs user interactions, page views, and navigation events, sending the data to a specified tracking endpoint or printing it to the console for development purposes.

Features

  • Tracks full-page loads and internal navigation events.
  • Captures user information from Flask sessions (ID, email, full name).
  • Supports ignoring specific routes and callbacks.
  • Sends tracking data via HTTP requests or logs to the console.
  • Seamless integration with Dash and Flask.

Usage

Simply instantiate Tracker with your Dash app:

from dash import Dash
from dash_tracker import Tracker

app = Dash(__name__)
tracker = Tracker(app, tracker_endpoint="https://your-tracker-endpoint.com")

If no tracking endpoint is provided, events are logged to the console.

The information captured by the tracker will look like this:

{
    "event": "page_view",
    "data":
    {
        "ip": "127.0.0.1",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
        "base_url": "http://127.0.0.1:8050/",
        "url": "http://127.0.0.1:8050/",
        "url_root": "http://127.0.0.1:8050/",
        "referrer": null,
        "path": "/",
        "full_path": "/?",
        "method": "GET",
        "user_id": "anonymous",
        "email": "anonymous",
        "full_name": "anonymous"
    },
    "timestamp": "2025-01-30T20:29:28.543062+00:00"
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dash_user_tracker-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dash_user_tracker-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file dash_user_tracker-0.1.0.tar.gz.

File metadata

  • Download URL: dash_user_tracker-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.4 Darwin/24.1.0

File hashes

Hashes for dash_user_tracker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 39f46fc6f58f8bd19e13c0c1f9474ab581d4c367ee3104872f4b65465839421d
MD5 f6444a4f660ff1d5c62c94b7fa3e3610
BLAKE2b-256 6d693396a678329027aa2543a310340551c48cfd793e30bb768c2ea008960e73

See more details on using hashes here.

File details

Details for the file dash_user_tracker-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dash_user_tracker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.4 Darwin/24.1.0

File hashes

Hashes for dash_user_tracker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 808fe198b125a82f2d7fde1f921dbfca14f72e1920f12ff767a0dc49b42a16c9
MD5 874202a970090c765476809b3c5fd782
BLAKE2b-256 61195c511f0b08aec9babfd8c04e72b9a178224f68af60edb1e7dbbb7301d35d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page