Skip to content
Go back

Announcing our PostHog Integration

Updated:

What is PostHog?

PostHog is an open-source product analytics platform that helps companies understand how users interact with their websites or applications. It allows businesses to track user behaviour, analyse data, and gain insights to improve their products or services. PostHog provides features for growth marketers including:

Table of contents

Open Table of contents

What is Growth Method?

Growth Method is the growth marketing platform for experiment-led and data-driven marketers. Unlike other project management tools like Monday.com and Asana, Growth Method helps marketing teams generate growth, not tasks.

It does this by integrating with core technology in your marketing stack (such as Google Analytics, Salesforce, HubSpot … and now PostHog) enabling you to track and share results right alongside your work.

Integration overview

With Growth Method integrations you can track marketing and sales related metrics right alongside marketing and growth experiments, including:

For B2B marketers looking to get more out of PostHog data, see our guide on HogQL snippets for B2B marketing teams.

Integration details

The Growth Method app automatically requests time series data from your connected apps on a daily basis. A standardised set of Growth Method parameters that exist across all vendor integrations as follows:

Data must be received as JSON formatted value, date pairs. This data is cached for 24 hours by default.

[
    {
        "value": 5,
        "date": 20230101
    },
    {
        "value": 21,
        "date": 20230102
    },
    {
        "value": 34,
        "date": 20230103
    },
    {
        "value": 33,
        "date": 20230104
    },
    {
        "value": 32,
        "date": 20230105
    },
    {
        "value": 28,
        "date": 20230106
    }
]

PostHog API

The PostHog API documentation is at https://posthog.com/docs/api.

API rate limits

PostHog rate limits are detailed here https://posthog.com/docs/api#rate-limiting and exist as follows:

API authentication

PostHog provide a number of options for authentication using a personal API key, these include:

To setup authentication you need to:

Ensure access to specific project This API key will only allow access to selected projects (not all access, or a whole organisation). For more information see https://posthog.com/docs/api.

Time formats

By default PostHog uses UTC for timestamps. To ensure maximum compatibility with PostHog timestamp and sent_at fields should be in ISO-8601 format. ISO 8601 is an internationally agreed way to represent dates: YYYY-MM-DD

2023-12-13T15:45:30.123Z or YYYY-MM-DDTHH:MM:SSZ

Note: the required date format in Growth Method is date YYYYMMDD e.g. 20240413 (not 2024-04-13)

In PostHog, you can override the default date filters with the before and after properties. For example: “after”: “2024-01-01T00:00:00”, “before”: “2024-01-01T23:59:59”

API request configuration

Example Insight query

Insights are the main building blocks of product analytics, and we recommending using the Insights API for Growth Method integration. Using insights ensure data parity between PostHog and Growth Method. The steps are as follows:

"result\":[{\"data\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,0,0,1,1,0,3,2,1,0,2,2,0,1,3,3,0,2,0,3,0,0,0,2,4,1,0,2,0,1,0,0,2,1,1,1,2,1,0,5,54,1,3,1,0,2,4,3,2,0,0,1,0,1,2,0,5,2,1,2,1,3,5,3,3,6,2,5,5,3,0,3,2,2,4,4,8,2,1,3,4,1,3]

Example HogQL query

Note: The Events endpoint (https://posthog.com/docs/api/events) is deprecated. All integrations should now use the Query endpoint instead https://posthog.com/docs/api/query. You can query events using HogQL (https://posthog.com/docs/product-analytics/sql) via the query endpoint.

Make a POST request to /api/projects/:project_id/query with the required JSON payload, for example:

{"query":{"kind": "HogQLQuery", "query":"SELECT formatDateTime(timestamp,'%Y-%m-%d'), count() FROM events WHERE (event='config_call_booked' OR event='website_call_booked') AND timestamp > '{{20.startDate}}' AND timestamp '{{20.startDate}}' AND timestamp < '{{20.endDate}}' GROUP BY formatDateTime(timestamp,'%Y-%m-%d') ORDER BY formatDateTime(timestamp,'%Y-%m-%d') DESC"}}

ChatGPT responds explaining the issue with the syntax and the correct SQL below

Frequently asked questions

What are webhooks?

Webhooks are often used when multiple applications need to work together. A webhook is a communication mechanism for one application (Application A) to automatically send a message or information to another application (Application B) in response to a specific event.

What is JSON?

JSON is a collection of key value pairs, separated by a comma (,), it doesn’t matter the order these pairs are written in. Individual keys and values are separated by a colon (:) and json always has an opening curly bracket ({) and closing curly bracket (}).

JSON arrays use square opening and closing brackets. Items in arrays are maintained in a collection denoted by curly brackets. Simple arrays have no collections, they are just a comma separated list with no keys. It is also possible to have nested, or multidimensional, arrays.


Back to top ↑