You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// github-demo is a demo deployment off of a specific branch.
83
+
switch(location.hostname){
84
+
case'localhost':
85
+
env.current='dev';
86
+
break;
87
+
case'cmsgov.github.io':
88
+
env.current='github-demo';
89
+
break;
90
+
case'design.cms.gov':
91
+
env.current='prod';
92
+
break;
93
+
default:
94
+
env.current='prod';
95
+
}
96
+
97
+
constanalyticsPayload={
98
+
content_language: 'en',
99
+
content_type: 'html',
100
+
logged_in: 'false',
101
+
page_name: tabTitle,
102
+
page_type: tabTitle.includes('Page not found') ? 'true' : 'false',//If page is a 404 (error page) this is set to true, otherwise it is false
103
+
site_environment: env.current,//Used to include or exclude traffic from different testing environments. Ex: test, test0, imp, production
104
+
site_section: location.pathname=='/' ? 'index' : location.pathname,// Set the section to the pathname, except in the case of the index.
105
+
}asany;
106
+
107
+
sendViewEvent(analyticsPayload);
108
+
}
109
+
},[]);
110
+
75
111
return(
76
112
<divdata-theme={theme}id={pageId}>
77
113
<Helmet
@@ -99,8 +135,13 @@ const Layout = ({
99
135
: 'The CMS Design System is a set of open source design and front-end development resources for creating Section 508 compliant, responsive, and consistent websites.'
0 commit comments