Skip to content

Commit 1dfcc4a

Browse files
committed
For test.
1 parent 9df58d3 commit 1dfcc4a

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/components/partials/htmlHead.js

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,7 @@ import { Script } from 'gatsby';
44
/**
55
* Heap Analytics script
66
*/
7-
const Heap = () => {
8-
const ID = '2306378928';
9-
// if (process.env.CONTEXT && ['production'].includes(process.env.CONTEXT)) {
10-
return (
11-
<Script id="heap-id" strategy="afterInteractive">
12-
{`
13-
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o<p.length;o++)heap[p[o]]=n(p[o])};
14-
heap.load(${ID});
15-
`}
16-
</Script>
17-
);
18-
// }
19-
// return null;
20-
};
7+
const ID = '2306378928';
218

229
/*
2310
** The HtmlHead component is included into the html.js file, to always be loaded.
@@ -121,7 +108,13 @@ const HtmlHead = () => {
121108
href="https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Source+Serif+4:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap"
122109
rel="stylesheet"
123110
/>
124-
<Heap />
111+
<Script id="heap-id" strategy="afterInteractive">
112+
{`
113+
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o<p.length;o++)heap[p[o]]=n(p[o])};
114+
heap.load(${ID});
115+
`}
116+
</Script>
117+
<meta name="postheap" content="true" />
125118
</>
126119
);
127120
};

0 commit comments

Comments
 (0)