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

  • Overview
    • Quickstart with PostHog Cloud
    • Overview
      • AWS
      • Azure
      • DigitalOcean
      • Google Cloud Platform
      • Hobby
      • 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
          • Kafka Engine
          • Resize disk
          • Restore
          • Vertical scaling
          • Horizontal scaling (Sharding & replication)
        • Kafka
          • Resize disk
          • Log retention
        • PostgreSQL
          • Resize disk
          • Troubleshooting long-running migrations
        • Plugin server
        • MinIO
        • Redis
        • Zookeeper
      • Disaster recovery
    • Troubleshooting and FAQs
    • Managing hosting costs
    • EU-only hosting
    • Overview
    • Ingest live data
    • Ingest historical data
    • Identify users
    • User properties
    • Deploying a reverse proxy
    • Libraries
    • Badge
      • Snippet installation
      • Android
      • iOS
      • JavaScript
      • Flutter
      • React Native
      • Browser Extensions
      • Elixir
      • Go
      • Java
      • Node.js
      • PHP
      • Python
      • Ruby
      • 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
    • Between Cloud and self-hosted
    • Overview
    • Tutorial
    • Troubleshooting
    • TypeScript types
    • Developer reference
    • 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
      • Braze Import
      • 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
  • Docs

  • Overview
    • Quickstart with PostHog Cloud
    • Overview
      • AWS
      • Azure
      • DigitalOcean
      • Google Cloud Platform
      • Hobby
      • 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
          • Kafka Engine
          • Resize disk
          • Restore
          • Vertical scaling
          • Horizontal scaling (Sharding & replication)
        • Kafka
          • Resize disk
          • Log retention
        • PostgreSQL
          • Resize disk
          • Troubleshooting long-running migrations
        • Plugin server
        • MinIO
        • Redis
        • Zookeeper
      • Disaster recovery
    • Troubleshooting and FAQs
    • Managing hosting costs
    • EU-only hosting
    • Overview
    • Ingest live data
    • Ingest historical data
    • Identify users
    • User properties
    • Deploying a reverse proxy
    • Libraries
    • Badge
      • Snippet installation
      • Android
      • iOS
      • JavaScript
      • Flutter
      • React Native
      • Browser Extensions
      • Elixir
      • Go
      • Java
      • Node.js
      • PHP
      • Python
      • Ruby
      • 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
    • Between Cloud and self-hosted
    • Overview
    • Tutorial
    • Troubleshooting
    • TypeScript types
    • Developer reference
    • 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
      • Braze Import
      • 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
  • Docs
  • Integrate PostHog
  • Overview

Integrate PostHog

Last updated: Sep 07, 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

  • Automatic Cohort Creator

    Group similar users into cohorts by their properties

  • Currency Normalizer

    Normalize multiple currencies in your events

  • Braze Import

    Sync data-series from Braze into PostHog once a day

  • BitBucket Release Tracker

    Track BitBucket releases in PostHog

  • Amazon Kinesis Importer

    Stream events from an Amazon Kinesis stream directly into PostHog

  • 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

  • Heartbeat

    Sends an event every minute to test PostHog is setup correctly

  • 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

  • GitLab Release Tracker

    Track and display GitLab releases

  • GitHub Star Sync

    Analyze your most important datapoint - GitHub Stars!

  • Twitter Followers Tracker

    Track the number of Twitter followers you have in PostHog

  • URL Normalizer

    Normalize the format of URLs in events

  • Zapier Connector

    Connect PostHog to 4,000+ other tools with Zapier

  • Unduplicator

    Clean up your data by removing duplicate events.

  • Zendesk Connector

    Sync Zendesk issues and customer data with PostHog

  • User Agent Populator

    Include browser details whenever a user agent is detected.

  • n8n Connector

    Create automated workflows in n8n to send data to PostHog

  • Segment Connector

    Send events to PostHog via Segment

  • Shopify Connector

    Sync customer and order data from Shopify into PostHog

  • GitHub Release Tracker

    Track GitHub releases in 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

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
  • About
  • Blog
  • Newsletter
  • Careers
  • Support
  • Contact sales

Product OS suite

Product overview

Analytics
  • Funnels
  • Trends
  • Paths

Pricing

Features
  • Session recording
  • Feature flags
  • Experimentation
  • Heatmaps

Customers

Platform
  • Correlation analysis
  • Collaboration
  • Apps

Community

Discussion
  • Questions?
  • Slack
  • Issues
  • Contact sales
Get involved
  • Roadmap
  • Contributors
  • Merch
  • PostHog FM
  • Marketplace

Docs

Getting started
  • PostHog Cloud
  • Self-hosted
  • Compare options
  • Tutorials
  • PostHog on GitHub
Install & integrate
  • Installation
  • Docs
  • API
  • Apps
User guides
  • Cohorts
  • Funnels
  • Sessions
  • Data
  • Events

Company

About
  • Our story
  • Team
  • Handbook
  • Investors
  • Careers
Resources
  • FAQ
  • Ask a question
  • Blog
  • Press
  • Merch
  • YouTube
© 2022 PostHog, Inc.
  • Code of conduct
  • Privacy
  • Terms