Skip to main content

altf1be_google_analytics_helpers

Helpers for Google Analytics facilitating the setting of the categories, actions, labels, User Id and User Agents.

See https://bitbucket.org/altf1be/altf1be_google_analytics_helpers

Google Analytics: https://analytics.google.com

Author: Abdelkrim BOUJRAF, http://www.alt-f1.be

Usage

  1. Create a .env including this parameter COM_GOOGLE_ANALYTICS_TRACKING_ID
export COM_GOOGLE_ANALYTICS_TRACKING_ID=G-XXXXXXXXXX
  1. Install python-dotenv
pip install python-dotenv
  1. load the .env in your entry point (app.py, main.py, test.py)
from dotenv import load_dotenv

load_dotenv()
  1. Run the code and check if the event is set on Google Analytics
from altf1be_google_analytics_helpers import GoogleAnalytics
import requests

googleAnalytics = GoogleAnalytics()

USER_ID: int, 0 if you DO NOT store a user_id 

googleAnalytics.track_event(
    category="set a category",
    action="set an action",
    label="set a label",
    value=0, # Event value, must be an integer. i.e. the value of a basket
    ua=request.headers.get("User-Agent"),
)

installation

  • install the package on pypi.org :

    • install : pip install altf1be_google_analytics_helpers
    • upgrade : pip install altf1be_google_analytics_helpers --upgrade
  • install the package on test.pypi.org :

    • install : pip install -i https://test.pypi.org/simple/altf1be_google_analytics_helpers
    • upgrade : pip install -i https://test.pypi.org/simple/altf1be_google_analytics_helpers --upgrade

dependencies

Build this package

Documentation to build a Python package

License

Copyright (c) ALT-F1 SPRL, Abdelkrim BOUJRAF. All rights reserved.

Licensed under the EUPL License, Version 1.2.

See LICENSE in the project root for license information.

Metadata

Release files for altf1be-google-analytics-helpers 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for altf1be-google-analytics-helpers 1.0.0
File Size Uploaded Provenance Actions
altf1be_google_analytics_helpers-1.0.0.tar.gz 9.7 kB Without provenance Details for altf1be_google_analytics_helpers-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for altf1be-google-analytics-helpers 1.0.0
File Interpreter ABI Platform Actions
altf1be_google_analytics_helpers-1.0.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for altf1be_google_analytics_helpers-1.0.0-py2.py3-none-any.whl

Total release size: 19.2 kB

Release files / altf1be_google_analytics_helpers-1.0.0.tar.gz

Download URL altf1be_google_analytics_helpers-1.0.0.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ebbe6a3b1f0e25a1ade9fd3b6633268c4028a6d4bb611d368e9a17e2a0c473fb
BLAKE2b-256 checksum
How to use checksums
16ab17fa7189a13d0ffae6f7ab84f5237978ef0064d06889bce4fbb36af37095
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

Release files / altf1be_google_analytics_helpers-1.0.0-py2.py3-none-any.whl

Download URL altf1be_google_analytics_helpers-1.0.0-py2.py3-none-any.whl
Size 9.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
87d867fc750d854d1b75bba1f3d882344769ac7dd07172d53dce037feaf19434
BLAKE2b-256 checksum
How to use checksums
4eae7f990794616ca989c06fa6cd984595d3dd1ab55aabcf809953e11de1f70c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

Security for altf1be-google-analytics-helpers 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page