forked from IBM-Design/design-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-ssr.js
36 lines (33 loc) · 802 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 = false;
window.digitalData = {
page: {
category: {
primaryCategory: 'PC010',
},
pageInfo: {
ibm: {
siteID: 'WWW_DESIGN',
country: 'US',
industry: 'Design',
owner: 'Alison Joseph/Austin/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"
/>,
]);
};