From f097a05c38ccb1355c50fde41648cf1106b78363 Mon Sep 17 00:00:00 2001 From: Ben Arent Date: Wed, 1 Nov 2023 16:54:08 -0700 Subject: [PATCH] debug posthog data --- components/Feedback/Feedback.tsx | 10 +++++++--- content/12.x | 2 +- content/13.x | 2 +- content/14.x | 2 +- content/15.x | 2 +- utils/posthog.ts | 1 + 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/components/Feedback/Feedback.tsx b/components/Feedback/Feedback.tsx index b144bed4d0..20ee44c163 100644 --- a/components/Feedback/Feedback.tsx +++ b/components/Feedback/Feedback.tsx @@ -18,7 +18,7 @@ export default function PageWithJSbasedForm(props) { const forwardData = async (data) => { const JSONdata = JSON.stringify(data); const endpoint = "/docs/api/feedback/"; - + console.log("Sending feedback to: " + endpoint); const options = { method: "POST", headers: { @@ -26,11 +26,13 @@ export default function PageWithJSbasedForm(props) { }, body: JSONdata, }; - + console.log("Sending feedback to: " + endpoint); const response = await fetch(endpoint, options); const result = await response.json(); - + console.log(result); + console.log("Feedback sent successfully!"); //Send feedback to posthog + console.log("Sending feedback to PostHog"); void sendDocsFeedback(data.feedback, data.comment); }; @@ -40,6 +42,7 @@ export default function PageWithJSbasedForm(props) { const handleSubmit = async (event: FormEvent) => { event.preventDefault(); + console.log(feedback); const data = { feedback, @@ -60,6 +63,7 @@ export default function PageWithJSbasedForm(props) { const handleFeedbackClick = async (feedbackValue: string) => { let feedback = feedbackValue; + console.log(feedbackValue); setFeedback(feedbackValue); setShowButtons(false); const data = { diff --git a/content/12.x b/content/12.x index 6eb82bdb04..40fae16696 160000 --- a/content/12.x +++ b/content/12.x @@ -1 +1 @@ -Subproject commit 6eb82bdb046ed68ef080c2de28f087dc3e638b75 +Subproject commit 40fae16696910224f8ff33483979c6c8c701d142 diff --git a/content/13.x b/content/13.x index 96cbdac87b..c654dd2ccb 160000 --- a/content/13.x +++ b/content/13.x @@ -1 +1 @@ -Subproject commit 96cbdac87b73e9944072d4dc227f5480b1b66230 +Subproject commit c654dd2ccbbc22db47ef019c6649244ad9fe0aab diff --git a/content/14.x b/content/14.x index 473214eb45..0395991fda 160000 --- a/content/14.x +++ b/content/14.x @@ -1 +1 @@ -Subproject commit 473214eb450361cb068a09af2bca21267a474391 +Subproject commit 0395991fdadcee33dbe52e2b349ef2d7fad8f355 diff --git a/content/15.x b/content/15.x index 50ff9c40c4..b084c7e60f 160000 --- a/content/15.x +++ b/content/15.x @@ -1 +1 @@ -Subproject commit 50ff9c40c48834c6f00b067239a35a09cc448c5f +Subproject commit b084c7e60f7f9185737bb4a53eb4be451bc299aa diff --git a/utils/posthog.ts b/utils/posthog.ts index 8f47892a07..86455c31b6 100644 --- a/utils/posthog.ts +++ b/utils/posthog.ts @@ -42,6 +42,7 @@ export const sendPageview = async () => { export const sendDocsFeedback = async (rating: string, comment: string) => { const ph = await posthog(); + console.log("sendDocsFeedback", rating, comment); ph?.capture("web.docs.feedback", { "web.docs.rating": rating,