tessl install tessl/pypi-posthog@6.7.0Integrate 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%
Build a B2B analytics tracker that manages organization and team-level analytics for a SaaS application.
Your tracker should support tracking multiple types of groups (organizations and teams) with their properties. The system should:
Create a module with three functions:
Provides analytics and tracking capabilities for B2B applications.
@generates
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