forked from carbon-design-system/carbon-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-browser.js
34 lines (33 loc) · 960 Bytes
/
gatsby-browser.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* eslint-disable import/prefer-default-export */
import './src/styles/index.scss';
export const onClientEntry = () => {
if (window.fathom) {
window.addEventListener('load', () => {
switch (window.navigator.language.slice(0, 2)) {
case 'en':
window.fathom('trackGoal', 'VIWQLLAA', 0);
break;
case 'zh':
window.fathom('trackGoal', 'GTB7NIQZ', 0);
break;
case 'es':
window.fathom('trackGoal', '3FC1DPEL', 0);
break;
case 'ar':
window.fathom('trackGoal', 'C8ODCSVW', 0);
break;
case 'pt':
window.fathom('trackGoal', 'JW5BELDY', 0);
break;
case 'de':
window.fathom('trackGoal', 'WRXNAWW6', 0);
break;
case 'fr':
window.fathom('trackGoal', 'SXUCR6V6', 0);
break;
default:
window.fathom('trackGoal', 'OQLWLPHN', 0);
}
});
}
};