From 09838c900af6ee004162a579812e27943e92ea68 Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Sat, 17 Jul 2021 18:28:54 -0700 Subject: [PATCH] switch posthog for matomo --- gatsby-browser.js | 7 ------- package.json | 1 - src/components/GalleryImage/GalleryImage.js | 2 -- src/html.js | 17 +++++++++++++++++ src/pages/index.js | 4 ---- yarn.lock | 12 ------------ 6 files changed, 17 insertions(+), 26 deletions(-) diff --git a/gatsby-browser.js b/gatsby-browser.js index 1496df7..d1dd60a 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -1,17 +1,10 @@ import "./src/styles/global.css"; -import posthog from "posthog-js"; const env = process.env.GATSBY_ACTIVE_ENV || process.env.NODE_ENV || "development"; -if (env === "production") { - posthog.init("HR8Gte105aCHNx2BqhL1XkbvH9kzKGptxjkbhuTj6Ek", { - api_host: "https://posthog.chuckdries.com", - }); -} export const onRouteUpdate = function () { if (env === "production" && typeof window.plausible === "object") { window.plausible("pageview"); - posthog.capture("$pageview"); } }; // import * as React from 'react'; diff --git a/package.json b/package.json index 457f882..c5b11e3 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,6 @@ "node-vibrant": "3.1.6", "postcss": "^8.3.4", "postcss-nested": "^5.0.5", - "posthog-js": "^1.11.3", "ramda": "^0.27.1", "react": "^17.0.1", "react-dom": "^17.0.1", diff --git a/src/components/GalleryImage/GalleryImage.js b/src/components/GalleryImage/GalleryImage.js index 785fa69..b9fd028 100644 --- a/src/components/GalleryImage/GalleryImage.js +++ b/src/components/GalleryImage/GalleryImage.js @@ -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 */ diff --git a/src/html.js b/src/html.js index 29a6594..c7365b2 100644 --- a/src/html.js +++ b/src/html.js @@ -31,6 +31,23 @@ export default function HTML(props) { {env === "production" && ( )} + {false && ( + + )} {props.preBodyComponents} diff --git a/src/pages/index.js b/src/pages/index.js index ccc7f23..834712f 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -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 }, }); diff --git a/yarn.lock b/yarn.lock index a4b400d..20ceeca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5897,11 +5897,6 @@ fd@~0.0.2: resolved "https://registry.yarnpkg.com/fd/-/fd-0.0.3.tgz#b3240de86dbf5a345baae7382a07d4713566ff0c" integrity sha512-iAHrIslQb3U68OcMSP0kkNWabp7sSN6d2TBSb2JO3gcLJVDd4owr/hKM4SFJovFOUeeXeItjYgouEDTMWiVAnA== -fflate@^0.4.1: - version "0.4.8" - resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.4.8.tgz#f90b82aefbd8ac174213abb338bd7ef848f0f5ae" - integrity sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA== - figures@^1.3.5: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" @@ -11033,13 +11028,6 @@ postcss@^8.2.15, postcss@^8.2.9: nanoid "^3.1.23" source-map-js "^0.6.2" -posthog-js@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.11.3.tgz#52e0b9265f22505a1ca4f6b5007090cab2692c5b" - integrity sha512-udk6Yv34XSzBl5P36H0fFCeL00/BbtjA9KpxvoXyGsxq5zCLkiS0x7FR+qde2AQJ+TNwEY/GZQVXs0hT66+Zng== - dependencies: - fflate "^0.4.1" - potrace@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/potrace/-/potrace-2.1.8.tgz#50f6fba92e1e39ddef6f979b0a0f841809e0acf2"