Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
debug posthog data
Browse files Browse the repository at this point in the history
  • Loading branch information
benarent committed Nov 1, 2023
1 parent 631c3e3 commit f097a05
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
10 changes: 7 additions & 3 deletions components/Feedback/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,21 @@ 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: {
"Content-Type": "application/json",
},
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);
};

Expand All @@ -40,6 +42,7 @@ export default function PageWithJSbasedForm(props) {

const handleSubmit = async (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
console.log(feedback);

const data = {
feedback,
Expand All @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion content/12.x
Submodule 12.x updated 1117 files
2 changes: 1 addition & 1 deletion content/13.x
Submodule 13.x updated 2203 files
2 changes: 1 addition & 1 deletion content/14.x
Submodule 14.x updated 3606 files
2 changes: 1 addition & 1 deletion content/15.x
Submodule 15.x updated 2183 files
1 change: 1 addition & 0 deletions utils/posthog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f097a05

Please sign in to comment.