switch posthog for matomo

This commit is contained in:
2021-07-17 18:28:54 -07:00
parent dc4176c47a
commit 09838c900a
6 changed files with 17 additions and 26 deletions

View File

@@ -12,13 +12,11 @@ import {
import { GatsbyImage, getImage } from "gatsby-plugin-image";
import { Helmet } from "react-helmet";
import classnames from "classnames";
import posthog from "posthog-js";
import MetadataItem from "./MetadataItem";
const logKeyShortcut = (keyCode) => {
try {
// eslint-disable-next-line
posthog.capture("[key shortcut]", { keyCode });
window.plausible("KeyShortcut", { props: { keyCode } });
} catch (e) {
/* do nothing */

View File

@@ -31,6 +31,23 @@ export default function HTML(props) {
{env === "production" && (
<script>{`window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }`}</script>
)}
{false && (
<script type="text/javascript">
{`
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//matomo.chuckdries.com/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
`}
</script>
)}
</head>
<body {...props.bodyAttributes}>
{props.preBodyComponents}

View File

@@ -4,7 +4,6 @@ import { GatsbyImage, getImage } from "gatsby-plugin-image";
import { Helmet } from "react-helmet";
import { take } from "ramda";
import classnames from "classnames";
import posthog from "posthog-js";
import {
getVibrantToHelmetSafeBodyStyle,
@@ -137,9 +136,6 @@ const IndexPage = ({
JSON.parse(localStorage.getItem("lastHeros")) || [];
if (env === "production") {
try {
posthog.capture("[shuffle image]", {
currentImage: currentImage?.base,
});
window.plausible("Shuffle", {
props: { currentImage: currentImage?.base },
});