Track an event
Use the capture
method to send custom events from your codebase. Use this data in PostHog for building cohorts, filtering insights, watching specific session replays, triggering feature flags, adding a user to an A/B test, and more.
Your code
posthog.capture('Plan purchased', {price: 12.99,planId: 'XYZ12345',term: 'monthly',features: {'Quality': 'HD','Seats': 2,'Downloads': false,},});
Available in PostHog
"event": { 8 items"created_at": "2023-06-28T10:12:38.789-07:00""distinct_id": "1193056043057""elements_chain": """event": "Plan purchased""properties": {...} 57 items"team_id": 1234"timestamp": "2023-06-28T08:57:37.083-07:00""uuid": "018902b9-797d-78df-a85e-73422079fcb5"}
You can also use autocapture to retroactively define events from the DOM structure with the toolbar.