From a3f561264ac8181785e80d96ac992133efe6095b Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 12 Mar 2020 05:36:36 +0100 Subject: [PATCH] fixes --- src/components/atoms/Ad.tsx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/components/atoms/Ad.tsx b/src/components/atoms/Ad.tsx index b59fc6c3..14e00aa0 100644 --- a/src/components/atoms/Ad.tsx +++ b/src/components/atoms/Ad.tsx @@ -2,26 +2,16 @@ import React from 'react' import styles from './Ad.module.scss' import { useSiteMetadata } from '../../hooks/use-site-metadata' -interface WindowWithMatomo extends Window { - _paq?: any -} - export default function Ad() { const { ad } = useSiteMetadata() - function handleClick(e: React.MouseEvent) { - e.preventDefault() - const { _paq } = window as WindowWithMatomo - _paq && _paq.push(['trackEvent', 'Ad Interaction', 'click']) - - window.open(ad.link) - } - return ( handleClick(e)} + data-track-content + data-content-name="Text Ad" + data-content-piece={ad.title} > {ad.title}