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
- Create a .env including this parameter COM_GOOGLE_ANALYTICS_TRACKING_ID
export COM_GOOGLE_ANALYTICS_TRACKING_ID=G-XXXXXXXXXX
- Install python-dotenv
pip install python-dotenv
- load the .env in your entry point (app.py, main.py, test.py)
from dotenv import load_dotenv
load_dotenv()
- 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 :
-
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
- install :
dependencies
- See requirements.txt
Build this package
-
build the setup.py
python3 setup.py sdist bdist_wheelpython3 -m pip install --user --upgrade twine --use-feature=2020-resolver
-
upload the library on TEST pypi.org
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*- Source : https://test.pypi.org/project/altf1be_helpers
-
upload the library on PROD pypi.org
python -m twine upload dist/*- Source : https://pypi.org/project/altf1be_helpers
Documentation to build a Python package
- Packaging Python Projects https://packaging.python.org/tutorials/packaging-projects/
- Managing Application Dependencies https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies
- Packaging and distributing projects https://packaging.python.org/guides/distributing-packages-using-setuptools/#distributing-packages
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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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.