Tracking pixel

Tracking pixel

Capture an event using a 1x1 tracking pixel. Useful for embedding tracking where PostHog SDKs are not available such as emails.

Configuration

OptionDescription
Event name
Type: string
Required: True

The name of the event to capture. You can derive this from a query parameter, or hard code it unique to this tracking pixel.

Distinct ID
Type: string
Required: True

The distinct ID this event should be associated with

Event properties
Type: json
Required: False

A mapping of the incoming webhook body to the PostHog event properties

Log payloads
Type: boolean
Required: False

Logs the incoming request for debugging

Using our REST API you can create this source_webhook like so:

Terminal
# Create a new destination
curl --location 'https://us.i.posthog.com/api/environments/:project_id/hog_functions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <POSTHOG_PERSONAL_API_KEY>' \
--data '{
"type": "source_webhook",
"name": "Tracking pixel",
"inputs": {
"event": {
"value": ""
},
"distinct_id": {
"value": ""
}
},
"enabled": true,
"template_id": "template-source-webhook-pixel"
}'

Community questions

Questions about this page? or post a community question.