or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/posthog@6.7.x
tile.json

tessl/pypi-posthog

tessl install tessl/pypi-posthog@6.7.0

Integrate PostHog into any python application.

Agent Success

Agent success rate when using this tile

89%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.03x

Baseline

Agent success rate without this tile

86%

task.mdevals/scenario-3/

B2B Analytics Tracker

Build a B2B analytics tracker that manages organization and team-level analytics for a SaaS application.

Requirements

Your tracker should support tracking multiple types of groups (organizations and teams) with their properties. The system should:

  1. Initialize the analytics client with proper configuration
  2. Set organization-level properties such as company name, subscription tier, and employee count
  3. Set team-level properties such as team name, department, and member count
  4. Support updating group properties when information changes (calling identify again with new properties)

Implementation Details

Create a module with three functions:

  • A function to initialize the analytics system with an API key
  • A function to set or update organization properties given an organization ID
  • A function to set or update team properties given a team ID

Test Cases

  • Initialize the analytics client with a valid API key @test
  • Set properties for an organization with ID 'org_123' (name: 'Acme Corp', tier: 'starter', employee_count: 25) @test
  • Set properties for a team with ID 'team_456' (name: 'Engineering', department: 'Product', member_count: 8) @test
  • Update organization 'org_123' properties (tier: 'enterprise', employee_count: 50) @test

Dependencies { .dependencies }

posthog { .dependency }

Provides analytics and tracking capabilities for B2B applications.

@generates

API

def initialize_analytics(api_key: str, host: str = None) -> None:
    """
    Initialize the analytics system with the provided API key.

    Args:
        api_key: The PostHog project API key
        host: Optional custom host URL
    """
    pass


def set_organization_properties(org_id: str, properties: dict) -> None:
    """
    Set or update properties for an organization.

    Args:
        org_id: Unique identifier for the organization
        properties: Dictionary of organization properties (e.g., name, tier, employee_count)
    """
    pass


def set_team_properties(team_id: str, properties: dict) -> None:
    """
    Set or update properties for a team.

    Args:
        team_id: Unique identifier for the team
        properties: Dictionary of team properties (e.g., name, department, member_count)
    """
    pass