Skip to content
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

[docs] Add Google Analytics action for the styling menu #38085

Merged
merged 4 commits into from
Jul 28, 2023

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Jul 21, 2023

Adding Google event action for the styling menu options.

https://deploy-preview-38085--material-ui.netlify.app/base-ui/react-button/#basics

@mnajdova mnajdova added docs Improvements or additions to the documentation core Infrastructure work going on behind the scenes labels Jul 21, 2023
@mui-bot
Copy link

mui-bot commented Jul 21, 2023

Netlify deploy preview

https://deploy-preview-38085--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 84a5088

@mnajdova
Copy link
Member Author

Seems to be working as expected
image

@mnajdova mnajdova marked this pull request as ready for review July 21, 2023 10:57
@oliviertassinari
Copy link
Member

Since the switch is global, I think that it would be great to also track this as a User-scoped custom dimensions https://support.google.com/analytics/answer/10075209?hl=en. Knowing how often developers switch is interesting, but more importantly, we want to know how many demos in which style engine are used.

Effectively, reproducing the TS/JS tracking.

@mnajdova
Copy link
Member Author

mnajdova commented Jul 24, 2023

Created a User's custom dimension

image

mnajdova and others added 3 commits July 25, 2023 00:36
@oliviertassinari oliviertassinari force-pushed the docs/add-ga-for-styling-solution branch from e95b093 to 2015425 Compare July 24, 2023 22:39
@oliviertassinari
Copy link
Member

Rebased on HEAD.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 24, 2023

@mnajdova In your screenshot, the event label is empty, this is broken:

Screenshot 2023-07-25 at 00 41 21

I pushed a fix

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -673,6 +673,9 @@ export default function DemoToolbar(props) {
>
<MenuItem
value={CODE_STYLING.SYSTEM}
data-ga-event-category="demo"
data-ga-event-action="styling-system"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update

const CODE_STYLING = {
  SYSTEM: 'MUI System',
  TAILWIND: 'Tailwind',
  CSS: 'CSS',
};

to match?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to follow how the other actions look like - they are all kebab-case.

@mnajdova mnajdova merged commit 33f7939 into mui:master Jul 28, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants