forked from carbon-design-system/design-language-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-ssr.js
36 lines (33 loc) · 809 Bytes
/
gatsby-ssr.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
35
36
import React from 'react';
export const onRenderBody = ({ setPostBodyComponents }) => {
if (process.env.NODE_ENV !== `production`) {
return null;
}
const script = `
if(!window) window = {};
window.idaPageIsSPA = true;
window.digitalData = {
page: {
category: {
primaryCategory: 'DESIGN',
},
pageInfo: {
ibm: {
siteID: 'DESIGN_LANGUAGE',
country: 'US',
industry: 'Design',
owner: 'Mike J Abbink/New York/IBM',
},
},
},
}`;
return setPostBodyComponents([
<script key="digital-data" dangerouslySetInnerHTML={{ __html: script }} />,
<script
defer
key="core-metrics"
src="https://1.www.s81c.com/common/stats/ibm-common.js"
type="text/javascript"
/>,
]);
};