Basic Posthog API integration - Add A Feature
In this video, we'll work on a feature to integrate PostHog analytics into the Craftwork web application. We create a Rails model to store marketing attribution data from PostHog called TrafficSource. The job fetches session data from the PostHog API, parses it, and stores relevant marketing metadata like UTM parameters, click IDs, referrers etc. in the TrafficSource model. Tests are written to validate the parsing and storage of the session data. The integration will allow the business to analyze the marketing funnel and tie revenue back to different traffic sources like Facebook/Google ads.
#rubyonrails #ruby #rails