SGM-6993 - Custom event instrumentation for PostHog #7028
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was created by GitStart to address the requirements from this ticket: SGM-6993.
This ticket was imported from: SGM-6993
Description:
Sets up custom event capture for the website using PostHog.
Events captured:
“Login” button clicks in nav bar
(event_name = ‘login_click’. Properties : current_page = The URL the user is viewing when they click the login button.)
Cody CTA button clicks (on the navbar)
Cody CTA button clicks (on a page)
Authentication button clicks
“Contact sales” button slicks
Form submission
[Sourcegraph Issue] Custom event instrumentation for PostHog #6993
[Ticket] https://clients.gitstart.com/sourcegraph/3436/tickets/SGM-6993
Each custom event requires an event name, and also in some cases custom properties for each event were captured. Check detailed documentation here: https://docs.google.com/document/d/1Lw3cJw6ZKsKoJff9ahYtX_Dg_ucZFnMDzgGc9qgBMg0/edit
DEMO:
https://www.loom.com/share/0040c2caa4a8453881c76f47ad37186e?sid=d358076a-5f25-41c4-94cb-890cfdcf6ad2
Test cases:
All documented events are captured and displayed in the posthog account activity logs
Each click is tracked and captured as requested in the documentation
Eventnames match what was requested in the documentation
Current page / position is returned in the captured event on the posthog activity section
Test plan:
-Login to the posthog account at https://us.posthog.com/
-Request login credentials from PM or TM
-Donot submit the form on "contact/request-info"
-Check demo video for testing scenarios