Documentation ¶
Overview ¶
Package posthog contains posthog helper functions and utilities
Index ¶
- func GetPackageToPosthogProperties(header *http.Header) posthog.Properties
- type Config
- type PostHog
- func (p *PostHog) AssociateUser(userID string, organizationID string)
- func (p *PostHog) Cleanup()
- func (p *PostHog) Event(eventName string, properties posthog.Properties)
- func (p *PostHog) GroupEvent(groupID, userID, eventName string, properties posthog.Properties)
- func (p *PostHog) NewGroup(groupID string, properties posthog.Properties)
- func (p *PostHog) NewOrganization(organizationID, userID string, properties posthog.Properties)
- func (p *PostHog) NewUser(userID string, properties posthog.Properties)
- func (p *PostHog) OrganizationEvent(organizationID, userID, eventName string, properties posthog.Properties)
- func (p *PostHog) OrganizationProperties(organizationID string, properties posthog.Properties)
- func (p *PostHog) Properties(id, obj string, properties posthog.Properties)
- func (p *PostHog) UserEvent(userID, eventName string, properties posthog.Properties)
- func (p *PostHog) UserProperties(userID string, properties posthog.Properties)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPackageToPosthogProperties ¶
GetPackageToPosthogProperties can be used to parse out an http header and map the headers to posthog properties array
Types ¶
type Config ¶
type Config struct { // Enabled is a flag to enable or disable PostHog Enabled bool `json:"enabled" koanf:"enabled" default:"false"` // APIKey is the PostHog API Key APIKey string `json:"apiKey" koanf:"apiKey"` // Host is the PostHog API Host Host string `json:"host" koanf:"host" default:"https://app.posthog.com"` }
Config is the configuration for PostHog
type PostHog ¶
type PostHog struct { Identifier string // contains filtered or unexported fields }
func (*PostHog) AssociateUser ¶
AssociateUser function is used to associate a user with an organization in PostHog
func (*PostHog) GroupEvent ¶ added in v0.4.2
GroupEvent creates an event associated with the group, where the eventName can be passed in generically and associated with the group ID if provided
func (*PostHog) NewOrganization ¶
NewOrganization uses the NewGroups reference to create a new organization in the organization groups category, and also sets attributes for the organization
func (*PostHog) OrganizationEvent ¶
func (p *PostHog) OrganizationEvent(organizationID, userID, eventName string, properties posthog.Properties)
OrganizationEvent creates an event associated with the organization, where the eventName can be passed in generically and associated with the org ID if provided
func (*PostHog) OrganizationProperties ¶
OrganizationProperties sets org properties
func (*PostHog) Properties ¶ added in v0.4.2
Properties sets generic properties
func (*PostHog) UserProperties ¶
UserProperties is to expand the properties of the user in the user group