Evntaly
Visit Evntaly
  • 💙Welcome to Evntaly
  • What is Evntaly ?
  • Why Evntaly ?
  • Getting Started
  • 📦Supported Langauges
    • JavaScript
    • Ruby
    • Python
    • C#
    • Go
    • PHP
    • Web
    • cURL
      • Swift – Native HTTP
      • Flutter - Dart
      • Android - Kotlin
Powered by GitBook
On this page
  • Installation
  • Initialization
  • Tracking Events
  • User Identification
  • Enabling and Disabling Tracking
  • Methods
  • Best Practices
  • Troubleshooting
  • Support
  1. Supported Langauges

Python

Python SDK

PreviousRubyNextC#

Last updated 3 months ago

The Evntaly Python SDK offers a seamless and flexible way to integrate event tracking, user identification, and analytics into your backend Python applications.

Installation

Install the Evntaly Python SDK using pip:

pip install evntaly-python

Initialization

from evntaly_python import EvntalySDK 

evntaly = EvntalySDK("YOUR_DEVELOPER_SECRET", "YOUR_PROJECT_TOKEN")

Tracking Events

For custom event tracking, use the track method.

evntaly.track({
    "title": "Payment Received",
    "description": "User completed a purchase",
    "message": "Order #12345",
    "data": {
        "user_id": "67890",
        "timestamp": "2025-01-08T09:30:00Z",
        "referrer": "social_media",
        "email_verified": True
    },
    "tags": ["purchase", "payment"],
    "notify": True,
    "icon": "💰",
    "apply_rule_only": False,
    "user": {"id": "0f6934fd-99c0-41ca-84f4"},
    "type": "Transaction",
    "sessionID": "20750ebc-dabf-4fd4-9498-443bf30d6095_bsd",
    "feature": "Checkout",
    "topic": "@Sales"
})

User Identification

Identify a user to associate events with a specific profile.

evntaly.identify_user({
    "id": "0f6934fd-99c0-41ca-84f4",
    "email": "user@example.com",
    "full_name": "John Doe",
    "organization": "ExampleCorp",
    "data": {
        "id": "JohnD",
        "email": "user@example.com",
        "location": "USA",
        "salary": 75000,
        "timezone": "America/New_York"
    }
})

Enabling and Disabling Tracking

You can enable or disable event tracking globally.

# Disable tracking
evntaly.disable_tracking()

# Enable tracking
evntaly.enable_tracking()

Methods

Method
Description
Example Usage
Available Since

track

Tracks a custom event.

evntaly.track({"title": 'Event'})

v1.0.0

identifyUser

Identifies a user for analytics.

evntaly.identify_user({"id": 'user-123'})

v1.0.0

disableTracking

Disables all event tracking.

evntaly.disable_tracking()

v1.0.0

enableTracking

Enables all event tracking.

evntaly.enable_tracking()

v1.0.0

Best Practices

  • Initialize early: Always initialize the SDK as early as possible.

  • Avoid sensitive data: Do not pass sensitive personal data directly to the SDK.

  • Monitor API limits: Regularly check API limits to avoid missing critical events.

Troubleshooting

  • Events not appearing: Check if the SDK is initialized correctly and the API tokens are valid.

  • Network errors: Ensure your network allows requests to https://evntaly.com.


Support

For additional help, contact support at support@evntaly.com.

Initialize the SDK with your Developer Secret and Project Token - Check

📦
Here
GitHub - Evntaly/evntaly-python: Evntaly official library for your Python projectsGitHub
Evntaly For Python
Logo