• Product
  • Pricing
  • Docs
  • Using PostHog
  • Community
  • Company
  • Login
  • Docs

  • Overview
    • Quickstart with PostHog Cloud
    • Overview
      • AWS
      • Azure
      • DigitalOcean
      • Google Cloud Platform
      • Hobby
      • EU Hosting Companies
      • Other platforms
      • Instance settings
      • Environment variables
      • Securing PostHog
      • Monitoring with Grafana
      • Running behind a proxy
      • Configuring email
      • Helm chart configuration
      • Deploying ClickHouse using Altinity.Cloud
      • Configuring Slack
      • Overview
        • Overview
        • Upgrade notes
        • Overview
        • 0001-events-sample-by
        • 0002_events_sample_by
        • 0003_fill_person_distinct_id2
        • ClickHouse
          • Backup
          • Debug hanging / freezing process
          • Horizontal scaling (Sharding & replication)
          • Kafka Engine
          • Resize disk
          • Restore
          • Vertical scaling
        • Kafka
          • Resize disk
          • Log retention
        • PostgreSQL
          • Resize disk
          • Troubleshooting long-running migrations
        • Plugin server
        • MinIO
        • Redis
        • Zookeeper
      • Disaster recovery
    • Troubleshooting and FAQs
    • Support for self-hosting (open-source and enterprise)
    • Managing hosting costs
    • Overview
    • Ingest live data
    • Ingest historical data
    • Identify users
    • User properties
    • Deploying a reverse proxy
    • Library comparison
    • Badge
    • Browser Extensions
      • Snippet installation
      • Android
      • iOS
      • JavaScript
      • Flutter
      • React Native
      • Node.js
      • Go
      • Python
      • Rust
      • Java
      • PHP
      • Ruby
      • Elixir
      • Docusaurus v2
      • Gatsby
      • Google Tag Manager
      • Next.js
      • Nuxt.js
      • Retool
      • RudderStack
      • Segment
      • Sentry
      • Slack
      • Shopify
      • WordPress
      • Message formatting
      • Microsoft Teams
      • Slack
      • Discord
    • To another self-hosted instance
    • To PostHog from Amplitude
    • To PostHog Cloud EU
    • Between Cloud and self-hosted
    • Overview
    • Tutorial
    • Troubleshooting
    • Developer reference
    • Using the PostHog API
    • Jobs
    • Testing
    • TypeScript types
    • Overview
    • POST-only public endpoints
    • Actions
    • Annotations
    • Cohorts
    • Dashboards
    • Event definitions
    • Events
    • Experiments
    • Feature flags
    • Funnels
    • Groups
    • Groups types
    • Insights
    • Invites
    • Members
    • Persons
    • Plugin configs
    • Plugins
    • Projects
    • Property definitions
    • Session recordings
    • Trends
    • Users
    • Data model
    • Overview
    • Data model
    • Ingestion pipeline
    • ClickHouse
    • Querying data
    • Overview
    • GDPR guidance
    • HIPAA guidance
    • CCPA guidance
    • Data egress & compliance
    • Data deletion
    • Overview
    • Code of conduct
    • Recognizing contributions
  • Using PostHog

  • Table of contents
      • Dashboards
      • Funnels
      • Group Analytics
      • Insights
      • Lifecycle
      • Path analysis
      • Retention
      • Stickiness
      • Trends
      • Heatmaps
      • Session Recording
      • Correlation Analysis
      • Experimentation
      • Feature Flags
      • Actions
      • Annotations
      • Cohorts
      • Data Management
      • Events
      • Persons
      • Sessions
      • UTM segmentation
      • Team collaboration
      • Organizations & projects
      • Settings
      • SSO & SAML
      • Toolbar
      • Notifications & alerts
    • Overview
      • Amazon Kinesis Import
      • BitBucket Release Tracker
      • Event Replicator
      • GitHub Release Tracker
      • GitHub Star Sync
      • GitLab Release Tracker
      • Heartbeat
      • Ingestion Alert
      • Email Scoring
      • n8n Connector
      • Orbit Connector
      • Redshift Import
      • Segment Connector
      • Shopify Connector
      • Twitter Followers Tracker
      • Zendesk Connector
      • Airbyte Exporter
      • Amazon S3 Export
      • BigQuery Export
      • Customer.io Connector
      • Databricks Export
      • Engage Connector
      • GCP Pub/Sub Connector
      • Google Cloud Storage Export
      • Hubspot Connector
      • Intercom Connector
      • Migrator 3000
      • PagerDuty Connector
      • PostgreSQL Export
      • Redshift Export
      • RudderStack Export
      • Salesforce Connector
      • Sendgrid Connector
      • Sentry Connector
      • Snowflake Export
      • Twilio Connector
      • Variance Connector
      • Zapier Connector
      • Downsampler
      • Event Sequence Timer
      • First Time Event Tracker
      • Property Filter
      • Property Flattener
      • Schema Enforcer
      • Taxonomy Standardizer
      • Unduplicator
      • Automatic Cohort Creator
      • Currency Normalizer
      • GeoIP Enricher
      • Timestamp Parser
      • URL Normalizer
      • User Agent Populator
  • Tutorials
    • All tutorials
    • Actions
    • Apps
    • Cohorts
    • Dashboards
    • Feature flags
    • Funnels
    • Heatmaps
    • Path analysis
    • Retention
    • Session recording
    • Trends
  • Support
  • Glossary
  • Docs

  • Overview
    • Quickstart with PostHog Cloud
    • Overview
      • AWS
      • Azure
      • DigitalOcean
      • Google Cloud Platform
      • Hobby
      • EU Hosting Companies
      • Other platforms
      • Instance settings
      • Environment variables
      • Securing PostHog
      • Monitoring with Grafana
      • Running behind a proxy
      • Configuring email
      • Helm chart configuration
      • Deploying ClickHouse using Altinity.Cloud
      • Configuring Slack
      • Overview
        • Overview
        • Upgrade notes
        • Overview
        • 0001-events-sample-by
        • 0002_events_sample_by
        • 0003_fill_person_distinct_id2
        • ClickHouse
          • Backup
          • Debug hanging / freezing process
          • Horizontal scaling (Sharding & replication)
          • Kafka Engine
          • Resize disk
          • Restore
          • Vertical scaling
        • Kafka
          • Resize disk
          • Log retention
        • PostgreSQL
          • Resize disk
          • Troubleshooting long-running migrations
        • Plugin server
        • MinIO
        • Redis
        • Zookeeper
      • Disaster recovery
    • Troubleshooting and FAQs
    • Support for self-hosting (open-source and enterprise)
    • Managing hosting costs
    • Overview
    • Ingest live data
    • Ingest historical data
    • Identify users
    • User properties
    • Deploying a reverse proxy
    • Library comparison
    • Badge
    • Browser Extensions
      • Snippet installation
      • Android
      • iOS
      • JavaScript
      • Flutter
      • React Native
      • Node.js
      • Go
      • Python
      • Rust
      • Java
      • PHP
      • Ruby
      • Elixir
      • Docusaurus v2
      • Gatsby
      • Google Tag Manager
      • Next.js
      • Nuxt.js
      • Retool
      • RudderStack
      • Segment
      • Sentry
      • Slack
      • Shopify
      • WordPress
      • Message formatting
      • Microsoft Teams
      • Slack
      • Discord
    • To another self-hosted instance
    • To PostHog from Amplitude
    • To PostHog Cloud EU
    • Between Cloud and self-hosted
    • Overview
    • Tutorial
    • Troubleshooting
    • Developer reference
    • Using the PostHog API
    • Jobs
    • Testing
    • TypeScript types
    • Overview
    • POST-only public endpoints
    • Actions
    • Annotations
    • Cohorts
    • Dashboards
    • Event definitions
    • Events
    • Experiments
    • Feature flags
    • Funnels
    • Groups
    • Groups types
    • Insights
    • Invites
    • Members
    • Persons
    • Plugin configs
    • Plugins
    • Projects
    • Property definitions
    • Session recordings
    • Trends
    • Users
    • Data model
    • Overview
    • Data model
    • Ingestion pipeline
    • ClickHouse
    • Querying data
    • Overview
    • GDPR guidance
    • HIPAA guidance
    • CCPA guidance
    • Data egress & compliance
    • Data deletion
    • Overview
    • Code of conduct
    • Recognizing contributions
  • Using PostHog

  • Table of contents
      • Dashboards
      • Funnels
      • Group Analytics
      • Insights
      • Lifecycle
      • Path analysis
      • Retention
      • Stickiness
      • Trends
      • Heatmaps
      • Session Recording
      • Correlation Analysis
      • Experimentation
      • Feature Flags
      • Actions
      • Annotations
      • Cohorts
      • Data Management
      • Events
      • Persons
      • Sessions
      • UTM segmentation
      • Team collaboration
      • Organizations & projects
      • Settings
      • SSO & SAML
      • Toolbar
      • Notifications & alerts
    • Overview
      • Amazon Kinesis Import
      • BitBucket Release Tracker
      • Event Replicator
      • GitHub Release Tracker
      • GitHub Star Sync
      • GitLab Release Tracker
      • Heartbeat
      • Ingestion Alert
      • Email Scoring
      • n8n Connector
      • Orbit Connector
      • Redshift Import
      • Segment Connector
      • Shopify Connector
      • Twitter Followers Tracker
      • Zendesk Connector
      • Airbyte Exporter
      • Amazon S3 Export
      • BigQuery Export
      • Customer.io Connector
      • Databricks Export
      • Engage Connector
      • GCP Pub/Sub Connector
      • Google Cloud Storage Export
      • Hubspot Connector
      • Intercom Connector
      • Migrator 3000
      • PagerDuty Connector
      • PostgreSQL Export
      • Redshift Export
      • RudderStack Export
      • Salesforce Connector
      • Sendgrid Connector
      • Sentry Connector
      • Snowflake Export
      • Twilio Connector
      • Variance Connector
      • Zapier Connector
      • Downsampler
      • Event Sequence Timer
      • First Time Event Tracker
      • Property Filter
      • Property Flattener
      • Schema Enforcer
      • Taxonomy Standardizer
      • Unduplicator
      • Automatic Cohort Creator
      • Currency Normalizer
      • GeoIP Enricher
      • Timestamp Parser
      • URL Normalizer
      • User Agent Populator
  • Tutorials
    • All tutorials
    • Actions
    • Apps
    • Cohorts
    • Dashboards
    • Feature flags
    • Funnels
    • Heatmaps
    • Path analysis
    • Retention
    • Session recording
    • Trends
  • Support
  • Glossary
  • Docs
  • Integrate PostHog
  • Overview

Integrate PostHog

Last updated: Aug 10, 2022

On this page

  • Snippet
  • Installation
  • Libraries
  • Client libraries
  • Server libraries
  • Apps
  • Installation
  • Ingestion apps (25)
  • API

After you have your PostHog deployment up and running, the next step is to start sending events. This guide gives a general overview of all the ways to bring data into PostHog, with links to guides that provide step-by-step information for setting up each method.

This guide covers the following:

  • JS Snippet: A small piece of JavaScript code you can include in your website to get tracking set up quick
  • Client libraries: Language and framework specific SDKs for more in-depth event tracking on the frontend
  • Server libraries: Packages for sending events to PostHog directly from your backend server
  • Apps: Integrate with 3rd party services to import data or transform your events
  • API: Send events directly to PostHog using our API

Note: The following information only covers how to bring in new events. If you have a data warehouse or database with past events, see this guide on importing historical data.

Snippet

This is the simplest way to get PostHog up and running on your website, and only takes a few minutes to set-up. This method generally works best for non-technical users or for very simple websites which don't need full tracking. If you do need to set up more detailed tracking, take a look at our client libraries.

After including the snippet on your website, it will automatically start to:

  • Capture $pageview events when a user visits a page
  • Track when users click on links or buttons
  • Record videos of user sessions that you can play back

Installation

For a detailed guide on how to install the snippet, read our installation guide.

Libraries

This is the most flexible way of integrating with PostHog, and generally the one we recommend if there's a package for the language or framework you're using.

These libraries allow you to:

  • Track events that aren't automatically captured
  • Add extra information to events
  • Identify logged-in users and attribute events to them
  • Use advanced functionality such as feature flags (If supported by your chosen library)

For more information, read the live data ingestion guide.

Client libraries

Client libraries let you send events to PostHog from your frontend website or app. This is generally the best option for tracking UI related events as well as events from anonymous users.

Official libraries

  • JavaScript
  • Android
  • iOS
  • Flutter
  • React Native

Check out the pages above for information on how to set-up each library, as well as which features each library supports.

Server libraries

Server libraries let you send events to PostHog directly from your backend server. In most cases, sending events from the server-side is the best and most reliable option, however this generally only works well for users who are signed in.

Official libraries

  • NodeJS
  • Python
  • PHP
  • Ruby
  • Golang
  • Java

Community libraries

  • Elixir
  • Nim

Check out the pages above for information on how to set-up each library, as well as which features each library supports. As a note, session recording is only supported in client-side libraries.

Apps

Apps extend PostHog's functionality and are an incredibly powerful part of the PostHog ecosystem. If you need to bring in data from a 3rd party service or perform some operation on all events coming into PostHog, apps are generally the best and most reliable option.

Apps can help you:

  • Import data from 3rd party services
  • Enrich events in your pipeline by adding extra data
  • Filter events to keep your data clean

Installation

Below is a list of all our apps for bringing data and events into PostHog. Apps can be installed from the app section in the dashboard. For information on how to set up each app, the list below contains links to each app's documentation page.

Ingestion apps (25)

For a list of all our apps, see here

  • Amazon Kinesis Importer

    Stream events from an Amazon Kinesis stream directly into PostHog

  • Automatic Cohort Creator

    Group similar users into cohorts by their properties

  • BitBucket Release Tracker

    Track BitBucket releases in PostHog

  • Currency Normalizer

    Normalize multiple currencies in your events

  • Downsampling

    Limit how many events are ingested into PostHog

  • Email Scoring

    Collects email scores for identified users with the Mailboxlayer API

  • GeoIP Enricher

    Add geographic data to PostHog events and persons using IP addresses

  • GitHub Release Tracker

    Track GitHub releases in PostHog

  • GitHub Star Sync

    Analyze your most important datapoint - GitHub Stars!

  • GitLab Release Tracker

    Track and display GitLab releases

  • Heartbeat

    Sends an event every minute to test PostHog is setup correctly

  • n8n Connector

    Create automated workflows in n8n to send data to PostHog

  • Orbit Connector

    Send workspace data from Orbit to PostHog

  • Property Filter

    Remove unwanted information from PostHog properties

  • Redshift Import

    Pull data from Amazon Redshift into PostHog as events

  • Segment Connector

    Send events to PostHog via Segment

  • Shopify Connector

    Sync customer and order data from Shopify into PostHog

  • Twitter Followers Tracker

    Track the number of Twitter followers you have in PostHog

  • Unduplicator

    Clean up your data by removing duplicate events.

  • URL Normalizer

    Normalize the format of URLs in events

  • User Agent Populator

    Include browser details whenever a user agent is detected.

  • Zapier Connector

    Connect PostHog to 4,000+ other tools with Zapier

  • Zendesk Connector

    Sync Zendesk issues and customer data with PostHog

For more detail on how apps work and tutorials on how to build your own, see our apps docs.

API

Events can also be ingested directly using our API and the /capture endpoint, which is the same endpoint that all of our libraries use behind the scenes.

Generally, this isn't something you'll need to use when integrating PostHog, but if you're working with a language or framework that PostHog doesn't support yet, this will allow you to still send events.

For more information, read our API docs.

Questions?

Was this page useful?

Next article

Ingest live data

PostHog enables you to analyze data in real-time, as events come in. Make full use of this power by ingesting live data with our analytics integrations: client libraries , server libraries , as well as third-party platforms . The purpose of this guide is to help you understand some key concepts with a goal of ingesting live data into PostHog. For simplicity, we'll focus on client libraries as a means of data ingestion. The guide covers the following: Installing and initializing a PostHog…

Read next article

Authors

  • Cory Watilo
    Cory Watilo
  • Eli Kinsey
    Eli Kinsey
  • Paul Hultgren
    Paul Hultgren

Share

Jump to:

  • Snippet
  • Installation
  • Libraries
  • Client libraries
  • Server libraries
  • Apps
  • Installation
  • Ingestion apps (25)
  • API
  • Questions?
  • Edit this page
  • Raise an issue
  • Toggle content width
  • Toggle dark mode
  • Product

  • Overview
  • Pricing
  • Product analytics
  • Session recording
  • A/B testing
  • Feature flags
  • Apps
  • Customer stories
  • PostHog vs...
  • Docs

  • Quickstart guide
  • Self-hosting
  • Installing PostHog
  • Building an app
  • API
  • Webhooks
  • How PostHog works
  • Data privacy
  • Using PostHog

  • Product manual
  • Apps manuals
  • Tutorials
  • Community

  • Questions?
  • Product roadmap
  • Contributors
  • Partners
  • Newsletter
  • Merch
  • PostHog FM
  • PostHog on GitHub
  • Handbook

  • Getting started
  • Company
  • Strategy
  • How we work
  • Small teams
  • People & Ops
  • Engineering
  • Product
  • Design
  • Marketing
  • Customer success
  • Company

  • About
  • Team
  • Investors
  • Press
  • Blog
  • FAQ
  • Support
  • Careers
© 2022 PostHog, Inc.
  • Code of conduct
  • Privacy policy
  • Terms