From cda6051026f70aa84d25926f77c9d696b95ebb22 Mon Sep 17 00:00:00 2001 From: Nancy <68706811+nancy-dassana@users.noreply.github.com> Date: Wed, 21 Jul 2021 16:39:11 -0700 Subject: [PATCH] 0.11.17 -> 0.11.18 (#404) --- package.json | 2 +- src/components/Pages/Error404.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7485e9b4..2c498c43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dassana-io/web-components", - "version": "0.11.17", + "version": "0.11.18", "publishConfig": { "registry": "https://npm.pkg.github.com/dassana-io" }, diff --git a/src/components/Pages/Error404.tsx b/src/components/Pages/Error404.tsx index 1cd919bf..ee46f9f8 100644 --- a/src/components/Pages/Error404.tsx +++ b/src/components/Pages/Error404.tsx @@ -6,7 +6,7 @@ import { faHome } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import random from 'lodash/random' import { styleguide } from 'components/assets/styles' -import React, { FC } from 'react' +import React, { FC, useEffect } from 'react' const { colors: { blacks, blues }, @@ -82,6 +82,13 @@ const error404Config = [ export const Error404: FC = ({ onBtnClick }: Error404Props) => { const classes = useStyles() + useEffect(() => { + const s = document.createElement('script') + s.innerHTML = + 'window.plausible && window.plausible("404",{ props: { path: document.location.pathname } })' + document.body.appendChild(s) + }, []) + const errorConfigIndex = random(error404Config.length - 1) const { title, msg, bg, renderButton } = error404Config[errorConfigIndex]