Skip to main content

Streamlit component that allows you to integrate Google Analytics by tag and send events to Google Analytics

Project description

Streamlit Google Analytics Tag (gtag)

A Streamlit component that allows you to integrate Google Analytics by tag and send events to Google Analytics.

Installation

pip install streamlit-google-analytics-tag

Usage

import streamlit as st
from streamlit_gtag import st_gtag

# Initialize Google Analytics
st_gtag(
    gtag_id="GA_MEASUREMENT_ID",
    config={
        "send_page_view": True
    }
)

# Send custom events
st_gtag(
    event="custom_event",
    parameters={
        "event_category": "engagement",
        "event_label": "button_click"
    }
)

Features

  • Easy integration with Google Analytics 4
  • Support for custom events
  • Streamlit-native component
  • Lightweight and fast

License

MIT License

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

streamlit_google_analytics_tag-1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

streamlit_google_analytics_tag-1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_google_analytics_tag-1.0.tar.gz.

File metadata

File hashes

Hashes for streamlit_google_analytics_tag-1.0.tar.gz
Algorithm Hash digest
SHA256 536d3fce997b44e5aec52bab78faa43096a4a96dac633a21f488a7d7a18113cc
MD5 5677836f6826b6f5f1e5f010075253c2
BLAKE2b-256 fa0c71c33f4207356d51f730b9e6106531022f3f6f708d31d03e2916e5618905

See more details on using hashes here.

File details

Details for the file streamlit_google_analytics_tag-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_google_analytics_tag-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5936c01f2d1114482c96fd505322e5d9124ebbcbdb2eabff0a1f308d66120f9c
MD5 d4f81c74ca2212c46bc862017bd795c6
BLAKE2b-256 a5ada4c16c3990223dfcde4de671eaab315239552f00a6b854591a8bd8eb2960

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