Skip to content

Commit 9573e82

Browse files
[docs] Improve analytics (#20337)
1 parent 8b795b2 commit 9573e82

File tree

16 files changed

+86
-89
lines changed

16 files changed

+86
-89
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ Diamond Sponsors are those who have pledged $1,500/month or more to Material-UI.
5555
via [Patreon](https://www.patreon.com/oliviertassinari)
5656

5757
<p style="display: flex; justify-content: center;">
58-
<a data-ga-event-category="sponsors" data-ga-event-action="logo" data-ga-event-label="tidelift" href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=material_ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/tidelift.png?size=96" alt="tidelift" title="Enterprise-ready open source software" /></a>
59-
<a data-ga-event-category="sponsors" data-ga-event-action="logo" data-ga-event-label="bitsrc" href="https://bit.dev" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/teambit.png?size=96" alt="bitsrc" title="The fastest way to share code" /></a>
58+
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="tidelift" href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=material_ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/tidelift.png?size=96" alt="tidelift" title="Enterprise-ready open source software" /></a>
59+
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="bitsrc" href="https://bit.dev" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/teambit.png?size=96" alt="bitsrc" title="The fastest way to share code" /></a>
6060
</p>
6161

6262
via [OpenCollective](https://opencollective.com/material-ui)
6363

6464
<p style="display: flex; justify-content: center; flex-wrap: wrap;">
65-
<a data-ga-event-category="sponsors" data-ga-event-action="logo" data-ga-event-label="callemall" href="https://www.call-em-all.com" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img src="https://images.opencollective.com/proxy/images?src=https%3A%2F%2Fopencollective-production.s3-us-west-1.amazonaws.com%2Ff4053300-e0ea-11e7-acf0-0fa7c0509f4e.png&height=100" alt="call-em-all" title="The easy way to message your group" width="100" loading="lazy"></a>
65+
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="callemall" href="https://www.call-em-all.com" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img src="https://images.opencollective.com/proxy/images?src=https%3A%2F%2Fopencollective-production.s3-us-west-1.amazonaws.com%2Ff4053300-e0ea-11e7-acf0-0fa7c0509f4e.png&height=100" alt="call-em-all" title="The easy way to message your group" width="100" loading="lazy"></a>
6666
</p>
6767

6868
Gold Sponsors are those who have pledged $500/month or more to Material-UI.
@@ -112,7 +112,7 @@ Check out our [documentation website](https://material-ui.com/).
112112

113113
## Premium Themes
114114

115-
You can find complete templates & themes in the [Material-UI store](https://material-ui.com/store/) .
115+
You can find complete templates & themes in the [Material-UI store](https://material-ui.com/store/?utm_source=docs&utm_medium=referral&utm_campaign=readme-store) .
116116

117117
## Contributing
118118

docs/notifications.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[
2+
{
3+
"id": 27,
4+
"text": "You can <a style=\"color: inherit;\" target=\"_blank\" rel=\"noopener\" href=\"https://twitter.com/MaterialUI\">follow us on Twitter</a> to receive exclusive tips and updates about Material-UI and the React ecosystem."
5+
},
26
{
37
"id": 35,
48
"title": "Let's translate!",

docs/pages/blog/2020-introducing-sketch.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ description: Today, we’re excited to announce the introduction of official Ske
66

77
Olivier Tassinari. March 30, 2020.
88

9-
Today, were excited to introduce the official Sketch symbols 💎 for Material-UI.
9+
Today, we're excited to introduce the Sketch symbols 💎 for Material-UI.
1010

11-
[![preview](/static/blog/2020-introducing-sketch/product-preview.png)](https://material-ui.com/store/items/sketch-react)
11+
[![preview](/static/blog/2020-introducing-sketch/product-preview.png)](https://material-ui.com/store/items/sketch-react/?utm_source=blog&utm_medium=blog&utm_campaign=introducing-sketch)
1212

1313
<p class="blog-description">Available on our <a href="https://material-ui.com/store/items/sketch-react">store</a></p>
1414

@@ -50,6 +50,14 @@ Create MVPs efficiently and save hundreds of hours on UI Design. This is a great
5050
Gain in autonomy, design beautiful, consistent and accessible interface without relying on designers. You can preview how it will look before coding it.
5151
The UI kit was created specifically for Material-UI, a popular React UI library with a comprehensive set of components.
5252

53+
## See it in action
54+
55+
The following video demonstrates how the symbols can be used to design an invoice page.
56+
57+
<iframe width="648" height="364" src="https://www.youtube.com/embed/DTU6r_VE2C4" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
58+
59+
Sketch Cloud preview: https://material-ui.com/store/previews/sketch-react/.
60+
5361
## More tools
5462

5563
According to a [recent user survey](https://medium.com/google-design/state-of-design-systems-2019-ff5f26ada71) ran by the Material Design Team, Sketch is the most popular tool used by teams to manage design systems. However, it's not the only tool.
@@ -64,4 +72,4 @@ We plan to release the support of **Figma** in the coming weeks. You can subscri
6472

6573
## Features
6674

67-
You can learn more about the features available on the [Sketch page details](https://material-ui.com/store/items/sketch-react/) of the symbols.
75+
You can learn more about the features available on the [Sketch page details](https://material-ui.com/store/items/sketch-react/?utm_source=blog&utm_medium=blog&utm_campaign=introducing-sketch) of the symbols.

docs/src/modules/components/Ad.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ const inHouseAds = [
5858
{
5959
name: 'themes-2',
6060
link:
61-
'https://material-ui.com/store/?utm_source=material_ui&utm_medium=referral&utm_campaign=in-house-2',
61+
'https://material-ui.com/store/?utm_source=docs&utm_medium=referral&utm_campaign=in-house-2',
6262
img: '/static/in-house/themes-2.jpg',
6363
description:
6464
'<b>Premium Templates</b><br />Start your project with the best themes for admins, dashboards and more.',
6565
},
6666
{
6767
name: 'themes',
6868
link:
69-
'https://material-ui.com/store/?utm_source=material_ui&utm_medium=referral&utm_campaign=in-house',
69+
'https://material-ui.com/store/?utm_source=docs&utm_medium=referral&utm_campaign=in-house',
7070
img: '/static/in-house/themes.png',
7171
description:
7272
'<b>Premium Themes</b><br />Kickstart your application development with a ready-made theme.',
7373
},
7474
{
7575
name: 'tidelift',
7676
link:
77-
'https://tidelift.com/subscription/managed-open-source-survey?utm_source=material_ui&utm_medium=referral&utm_campaign=enterprise&utm_content=ad',
77+
'https://tidelift.com/subscription/managed-open-source-survey?utm_source=docs&utm_medium=referral&utm_campaign=enterprise&utm_content=ad',
7878
img: '/static/in-house/tidelift.png',
7979
description:
8080
'<b>Material-UI for enterprise</b><br />Save time and reduce risk. Managed open source — backed by maintainers.',
@@ -89,7 +89,7 @@ const inHouseAds = [
8989
{
9090
name: 'sketch',
9191
link:
92-
'https://material-ui.com/store/items/sketch-react/?utm_source=material_ui&utm_medium=referral&utm_campaign=in-house-sketch',
92+
'https://material-ui.com/store/items/sketch-react/?utm_source=docs&utm_medium=referral&utm_campaign=in-house-sketch',
9393
img: '/static/in-house/sketch.png',
9494
description:
9595
'<b>Sketch</b><br />A large UI kit with over 1,500 handcrafted Material-UI symbols 💎.',

docs/src/modules/components/AppFrame.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ function AppFrame(props) {
224224
aria-haspopup="true"
225225
aria-label={t('changeLanguage')}
226226
onClick={handleLanguageIconClick}
227-
data-ga-event-category="AppBar"
227+
data-ga-event-category="header"
228228
data-ga-event-action="language"
229229
>
230230
<LanguageIcon />
@@ -279,36 +279,50 @@ function AppFrame(props) {
279279
</MenuItem>
280280
</Menu>
281281
</NoSsr>
282+
<Notifications />
282283
<Tooltip title={t('editWebsiteColors')} enterDelay={300}>
283284
<IconButton
284285
color="inherit"
285286
aria-label={t('editWebsiteColors')}
286287
component={Link}
287288
naked
288289
href="/customization/color/#color-tool"
289-
data-ga-event-category="AppBar"
290+
data-ga-event-category="header"
290291
data-ga-event-action="colors"
291292
>
292293
<ColorsIcon />
293294
</IconButton>
294295
</Tooltip>
296+
<Tooltip title={t('github')} enterDelay={300}>
297+
<IconButton
298+
component="a"
299+
color="inherit"
300+
href="https://github.com/mui-org/material-ui"
301+
aria-label={t('github')}
302+
data-ga-event-category="header"
303+
data-ga-event-action="github"
304+
>
305+
<GitHubIcon />
306+
</IconButton>
307+
</Tooltip>
295308
<Tooltip title={t('toggleTheme')} enterDelay={300}>
296309
<IconButton
297310
color="inherit"
298311
onClick={handleTogglePaletteType}
299312
aria-label={t('toggleTheme')}
300-
data-ga-event-category="AppBar"
313+
data-ga-event-category="header"
301314
data-ga-event-action="dark"
302315
>
303316
{theme.palette.type === 'light' ? <Brightness4Icon /> : <Brightness7Icon />}
304317
</IconButton>
305318
</Tooltip>
306319
<Tooltip title={t('toggleRTL')} key={theme.direction} enterDelay={300}>
307320
<IconButton
321+
edge="end"
308322
color="inherit"
309323
onClick={handleToggleDirection}
310324
aria-label={t('toggleRTL')}
311-
data-ga-event-category="AppBar"
325+
data-ga-event-category="header"
312326
data-ga-event-action="rtl"
313327
>
314328
{theme.direction === 'rtl' ? (
@@ -318,20 +332,6 @@ function AppFrame(props) {
318332
)}
319333
</IconButton>
320334
</Tooltip>
321-
<Notifications />
322-
<Tooltip title={t('github')} enterDelay={300}>
323-
<IconButton
324-
edge="end"
325-
component="a"
326-
color="inherit"
327-
href="https://github.com/mui-org/material-ui"
328-
aria-label={t('github')}
329-
data-ga-event-category="AppBar"
330-
data-ga-event-action="github"
331-
>
332-
<GitHubIcon />
333-
</IconButton>
334-
</Tooltip>
335335
</Toolbar>
336336
</AppBar>
337337
<AppDrawer

docs/src/pages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ const pages = [
197197
pathname: 'https://material-ui.com/store/',
198198
title: 'Store',
199199
linkProps: {
200-
'data-ga-event-category': 'premium-themes',
200+
'data-ga-event-category': 'store',
201201
'data-ga-event-action': 'click',
202-
'data-ga-event-label': 'sidenav-link',
202+
'data-ga-event-label': 'sidenav',
203203
},
204204
},
205205
{

docs/src/pages/components/material-icons/SearchIcons.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ import Link from 'docs/src/modules/components/Link';
2424
import * as mui from '@material-ui/icons';
2525
import synonyms from './synonyms';
2626

27+
if (process.env.NODE_ENV !== 'production') {
28+
Object.keys(synonyms).forEach((icon) => {
29+
if (!mui[icon]) {
30+
throw new Error(`The icon ${icon} does no longer exist.`);
31+
}
32+
});
33+
}
34+
2735
// Working on the logic? Uncomment these imports.
2836
// It will be x10 faster than working with all of the icons.
2937

0 commit comments

Comments
 (0)