Socket
Socket
Sign inDemoInstall

altf1be-google-analytics-helpers

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

altf1be-google-analytics-helpers

Google Analytics helpers facilitating the setting of the categories, actions, labels, User Id and User Agents built by www.alt-f1.be


Maintainers
1

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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc