-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Google Analytics events to Playground #1040
Conversation
@@ -34,6 +35,17 @@ export default function PlaygroundViewport({ | |||
storage, | |||
}); | |||
|
|||
// Add GA events for blueprint steps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's document what is being logged and why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a readme file with more details. Let me know if there is a better place to document this.
packages/playground/website/src/components/playground-viewport/index.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left two nitpicks, but other than that we're good to merge so I'm approving this PR 🎉
Thanks for making these changes and merging! |
Is there no consent request before loading these? I believe we need to enqueue analytics until we ask for and receive consent. |
Analytics were already on the site, this PR just adds extra events. But that's a good point we should add a consent request. |
What is this PR doing?
This PR adds support for sending Google Analytics events.
Events are sent when the Playground website loads. There is a general load event to track the number of loads, and separate events for each step that send just the step name.
What problem is it solving?
We would like to better understand if people are using the features we build specifically what steps are used and how frequently.
How is the problem addressed?
By sending step names to Google Analytics we will be able to track the total number of times a step has been used and compare it to the number of events created.
Testing Instructions
npm run dev
console.log(event, data);
after this linewordpress-playground/packages/playground/website/src/lib/tracking.ts
Line 21 in 05105b8