Removed Google analytics from site
This commit is contained in:
parent
ac64158f9a
commit
70def2783d
7 changed files with 4 additions and 53 deletions
|
|
@ -7,7 +7,6 @@ const AbAudioPlayer = (audiodata) => {
|
|||
<div className="audio">
|
||||
<AudioPlayer
|
||||
src={audiodata.audio_mp3.url}
|
||||
//onPlay={e => gtag.event({action: "play", category:"audio", label: "audio started", value: audiodata.audio_mp3})}
|
||||
onPlay={_paq.push(['trackEvent', 'Podcasts', 'Play Podcast', audiodata.audio_mp3])}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
21
lib/gtag.js
21
lib/gtag.js
|
|
@ -1,21 +0,0 @@
|
|||
export const GA_TRACKING_ID = process.env.GTAG //'G-HDSXTW54QC'
|
||||
|
||||
console.log(GA_TRACKING_ID)
|
||||
|
||||
// https://developers.google.com/analytics/devguides/collection/gtagjs/pages
|
||||
export const pageview = (url) => {
|
||||
window.gtag('config', GA_TRACKING_ID, {
|
||||
page_path: url,
|
||||
})
|
||||
console.log("Page view action")
|
||||
}
|
||||
|
||||
// https://developers.google.com/analytics/devguides/collection/gtagjs/events
|
||||
export const event = ({ action, category, label, value }) => {
|
||||
window.gtag('event', action, {
|
||||
event_category: category,
|
||||
event_label: label,
|
||||
value: value,
|
||||
})
|
||||
console.log("event sent: " + action + ":" + category + ":" + label + ":" + value)
|
||||
}
|
||||
|
|
@ -11,13 +11,11 @@ module.exports = {
|
|||
base_path: 'http://localhost:1337/api/',
|
||||
audio_path: 'https://audio.angrybeanie.com/',
|
||||
media_path: process.env.MEDIA_BASE,
|
||||
strapi_token: process.env.STRAPI_TOKEN,
|
||||
gtag: process.env.GTAG
|
||||
strapi_token: process.env.STRAPI_TOKEN
|
||||
},
|
||||
images: {
|
||||
domains: ['www.angrybeanie.com', 'localhost', 'cms.local.angrybeanie.com', '127.0.0.1']
|
||||
},
|
||||
publicRuntimeConfig: {
|
||||
analytics_code: process.env.GTAG
|
||||
}
|
||||
}
|
||||
|
|
@ -6,12 +6,10 @@ import { Fragment, useEffect } from 'react';
|
|||
import "../components/css/styles.css"
|
||||
import { Router, useRouter } from 'next/router'
|
||||
|
||||
//Router.events.on('routeChangeComplete', (url) => gtag.pageview(url))
|
||||
|
||||
import { init } from "@socialgouv/matomo-next";
|
||||
|
||||
const MATOMO_URL = "https://analytics.angrybeanie.com";
|
||||
const MATOMO_SITE_ID = 2;
|
||||
const MATOMO_URL = process.env.NEXT_PUBLIC_MATOMO_URL;
|
||||
const MATOMO_SITE_ID = process.env.NEXT_PUBLIC_MATOMO_SITE_ID;
|
||||
|
||||
console.log(MATOMO_URL);
|
||||
|
||||
|
|
@ -19,8 +17,7 @@ function MyApp({ Component, pageProps }) {
|
|||
const router = useRouter()
|
||||
useEffect(() => {
|
||||
const handleRouteChange = (url) => {
|
||||
// gtag.pageview(url);
|
||||
// console.log("Pageview is happening")
|
||||
|
||||
};
|
||||
init({ url: MATOMO_URL, siteId: MATOMO_SITE_ID });
|
||||
router.events.on("routeChangeComplete", handleRouteChange);
|
||||
|
|
|
|||
|
|
@ -2,32 +2,12 @@ import Document, { Html, Head, Main, NextScript } from 'next/document';
|
|||
import React from 'react';
|
||||
import { Fragment } from 'react'
|
||||
|
||||
import { GA_TRACKING_ID } from '../lib/gtag'
|
||||
|
||||
class CustomDocument extends Document {
|
||||
render() {
|
||||
return (
|
||||
<Html lang="en">
|
||||
<Head>
|
||||
<Fragment>
|
||||
{/* Global Site Tag (gtag.js) - Google Analytics */}
|
||||
<script
|
||||
async
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
|
||||
/>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '${GA_TRACKING_ID}', {
|
||||
page_path: window.location.pathname,
|
||||
});
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
<link rel="icon" href="/images/favicon-32.png" sizes="32x32" />
|
||||
<link rel="icon" href="/images/favicon-57.png" sizes="57x57" />
|
||||
<link rel="icon" href="/images/favicon-76.png" sizes="76x76" />
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import FeatureImage from "../../components/featureimage.js"
|
|||
import StorySideBar from '../../components/storysidebar.js'
|
||||
import PublishedInfo from '../../components/publishedinfo.js'
|
||||
import { getAllPosts, getSinglePost } from '../../data/external/cms'
|
||||
import * as gtag from "../../lib/gtag"
|
||||
import Image from "next/legacy/image";
|
||||
import Head from 'next/head'
|
||||
import config from "../../data/internal/config"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { useRouter } from 'next/router'
|
||||
import getConfig from 'next/config'
|
||||
import Layout from "../../../components/main.js"
|
||||
import * as gtag from "../../../lib/gtag"
|
||||
import AudioPlayer from "react-h5-audio-player";
|
||||
import 'react-h5-audio-player/lib/styles.css';
|
||||
import EpisodeSideBar from "../../../components/episodesidebar"
|
||||
|
|
|
|||
Loading…
Reference in a new issue