Skip to main content

Python

Requirements

  • Access permission to your Python website or server code

  • Able to write Python code to integrate our Python SDK with your system.

Use Cases

  • Track user identity, behaviors or transactions event from your Python backend server.

Guideline

Installation

pip install filum-analytics-python

Usage

As server-side application doesn’t have local storage to persist user_id or anonymous_id so you must specify either user_id or anonymous_id in your tracking code.

import uuid
from filum_analytics.client import Client
_client = Client(write_key="WRITEKEY")
analytics_python = _client

# track call for Server source like Python or NodeJS must include anonymousID or userID
analytics_python.identify(anonymous_id=str(uuid.uuid4()), event_params={
"Name": "Harry Potter",
"Email": "example@gmail.com"
})

analytics_python.track(anonymous_id=str(uuid.uuid4()), event_name="Transaction Completed", event_params={
"Transaction ID": "#001",
"Total Value": 1000000
})