Created
June 17, 2019 08:52
-
-
Save kayode-adechinan/e1b8084c59e855c40670acec462ab091 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .static/analytics.js | |
!(function(f, b, e, v, n, t, s) { | |
if (f.fbq) return; | |
n = f.fbq = function() { | |
n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments); | |
}; | |
if (!f._fbq) f._fbq = n; | |
n.push = n; | |
n.loaded = !0; | |
n.version = "2.0"; | |
n.queue = []; | |
t = b.createElement(e); | |
t.async = !0; | |
t.src = v; | |
s = b.getElementsByTagName(e)[0]; | |
s.parentNode.insertBefore(t, s); | |
})( | |
window, | |
document, | |
"script", | |
"https://connect.facebook.net/en_US/fbevents.js" | |
); | |
fbq("init", "2204225232930801"); | |
fbq("track", "PageView"); | |
window.dataLayer = window.dataLayer || []; | |
function gtag() { | |
dataLayer.push(arguments); | |
} | |
gtag("js", new Date()); | |
gtag("config", "UA-124816410-2"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .pages/_document.js | |
import Document, { Head, Main, NextScript } from "next/document"; | |
export default class MyDocument extends Document { | |
render() { | |
return ( | |
<html> | |
<Head /> | |
<body> | |
<Main /> | |
<NextScript /> | |
<script src="https://code.jquery.com/jquery-3.4.1.min.js" async /> | |
<script | |
async | |
src="https://www.googletagmanager.com/gtag/js?id=UA-124816410-2" | |
/> | |
<script src="/static/analytics.js" async /> | |
</body> | |
</html> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment