Skip to main content

The Carter Analytics SDK is a powerful tool for tracking and analyzing user interactions in your Python applications. It provides a straightforward way to capture a wide range of events and send them to the Carter Analytics platform for processing and analysis.

Project description

Carter Analytics SDK

The Carter Analytics SDK is a powerful tool for tracking and analyzing user interactions in your Python applications. It provides a straightforward way to capture a wide range of events and send them to the Carter Analytics platform for processing and analysis.

Installation

To install the Carter Analytics SDK, use pip:

pip install carter_analytics_sdk (Future scoping)

Importing the Client

To get started with the Carter Analytics SDK, you first need to import the carter_analytics_client from the SDK package:

from carter_analytics_sdk import carter_analytics_client

Initialization

Before publishing any events, initialize the SDK with your configuration:

carter_analytics_client.initialize([
    {
        "client_id": "your_client_id_here",
        "options": {
            # Additional options here
        }
    }
])

Publishing Events

The Carter Analytics SDK provides a variety of methods to publish different types of events. Here's how to use some of the key methods:

Core Events

Page View

carter_analytics_client.publish_page_view()

Search

carter_analytics_client.publish_search(query="your_search_query")

Sign Up

carter_analytics_client.publish_signup(method="signup_method", user_id="user123")

Login

carter_analytics_client.publish_login(method="login_method", user_id="user123")

Product Interactions

Product View

product = ProductItem(id="product_id", price=19.99, currency="USD", title="Product Title")
carter_analytics_client.publish_product_view(product)

Shopping Cart Actions

Add to Cart

cart_item = CartItem(id="product_id", price=19.99, currency="USD", title="Product Title", quantity=1)
carter_analytics_client.publish_add_to_cart(cart_amount=19.99, currency="USD", cart_items=[cart_item])

Checkout Process

Checkout Start

checkout_event = CheckoutStartEvent(token="checkout_token", amount=59.97, currency="USD", items=[cart_item], ...)
carter_analytics_client.publish_checkout_start(checkout_event)

Additional Methods

The SDK also supports publishing custom events, removing items from the cart, updating cart items, viewing the cart, completing a checkout, and canceling a checkout. For details on these and other methods, refer to the SDK documentation.

Starting the Background Worker

To process and send events to the Carter Analytics platform, you must start the background worker:

carter_analytics_client.start_background_worker()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carter_analytics_python_sdk-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carter_analytics_python_sdk-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file carter_analytics_python_sdk-0.1.0.tar.gz.

File metadata

File hashes

Hashes for carter_analytics_python_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 703dddb60e91f656e1404eb0543e85599b3ff2c93bd565ef710cc89691c91885
MD5 ce4be8c4b8f4e90bea648b53348148ef
BLAKE2b-256 ba1f6babe7aef72d3fdf74879dea7b21ee1bdca8acbd832482e8afccd1286f85

See more details on using hashes here.

File details

Details for the file carter_analytics_python_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for carter_analytics_python_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d3bd17032aab968d01cd031fcb28273099975eacd9fc5c24de9b751bd05579e
MD5 43b2e380c6ecbc3970c0caa5ead4a3a5
BLAKE2b-256 a4a939bfeec9125e5d2b5f8a54398811d028f3cf0dc1a2b770fb7cbda8ebed59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page