-
Notifications
You must be signed in to change notification settings - Fork 6
/
gatsby-ssr.js
38 lines (35 loc) · 1.14 KB
/
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
37
38
import React from "react";
// For Adsense
// export const onRenderBody = ({ setHeadComponents, setPostBodyComponents }) => {
// const pluginOptions = {
// googleAdClientId: `ca-pub-2352333389468696`, //TODO: Replace with your client-Id
// head: true // Set to false if you prefer to have your script loaded at the end of body instead of head.
// };
// if (process.env.NODE_ENV !== `production`) {
// return null;
// }
// if (pluginOptions.googleAdClientId === undefined) {
// return null;
// }
// const setComponents = pluginOptions.head
// ? setHeadComponents
// : setPostBodyComponents;
// return setComponents([
// <script
// async
// type="text/javascript"
// src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
// />,
// <script
// key={`gatsby-plugin-google-adsense`}
// dangerouslySetInnerHTML={{
// __html: `
// (adsbygoogle = window.adsbygoogle || []).push({
// google_ad_client: "${pluginOptions.googleAdClientId}",
// enable_page_level_ads: true
// });
// `
// }}
// />
// ]);
// };