Skip to content

Commit

Permalink
remove ga and sentry, replace with app insights module
Browse files Browse the repository at this point in the history
  • Loading branch information
Recidvst committed Jun 22, 2024
1 parent a12b34d commit 3d4f1ea
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
12 changes: 12 additions & 0 deletions components/icons/copyIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,19 @@ export default {
if (textElement) {
const textToCopy = textElement.textContent;
const strippedTextToCopy = textToCopy.replace(/\s\s+/g, ' ').trim();
const snippetID = textElement.getAttribute('data-id');
const snippetType = textElement.getAttribute('data-type');
const bookType = textElement.getAttribute('data-booktype');
copyToClipboard(strippedTextToCopy);
this.$appInsights.trackEvent({
name: 'copyToClipboard',
properties: {
textToCopy: strippedTextToCopy,
snippetID,
bookType,
contentType: snippetType,
}
});
target.classList.add('clicked');
setTimeout(() => {
target.classList.remove('clicked');
Expand Down
10 changes: 9 additions & 1 deletion components/quotes/Quote.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<li class="box columns is-12 is-flex is-vcentered">
<blockquote class="column is-11 quote" :data-id="content.id" :data-type="content.type">
<blockquote class="column is-11 quote" :data-id="content.id" :data-type="content.type" :data-booktype="bookType">
<strong v-if="isArchive && content.identifier" @click.prevent="goToSnippet($event)">({{ content.identifier }}) </strong>{{ content.text }}
</blockquote>
<div class="icon-box" :data-clipboard="index">
Expand Down Expand Up @@ -80,6 +80,14 @@ export default {
const snippetID = parent.querySelector('.quote').getAttribute('data-id');
const snippetType = parent.querySelector('.quote').getAttribute('data-type');
if (snippetID && snippetType) {
this.$appInsights.trackEvent({
name: 'goToSnippet',
properties: {
snippetID,
bookType: this.bookType,
contentType: snippetType,
}
});
this.$router.push({
path: `/${snippetType}/${this.bookType}/${snippetID}`,
});
Expand Down
15 changes: 3 additions & 12 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ export default {

// adding env variables to the Nuxt runtime
publicRuntimeConfig: {
GA_ID: process.env.GA_ID || 'gaid',
SENTRY_DSN: process.env.SENTRY_DSN || 'sentry_dsn',
SENTRY_DISABLED: process.env.SENTRY_DISABLED || false,
},
privateRuntimeConfig: {
APITOKEN: process.env.APITOKEN || 'token',
},

// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
Expand All @@ -57,10 +53,9 @@ export default {
modules: [
'@nuxt/content',
'@nuxtjs/dotenv',
'@nuxtjs/google-analytics',
'@nuxtjs/pwa',
'@nuxtjs/sitemap',
'@nuxtjs/sentry'
'@nuxtjs/applicationinsights',
],

// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
Expand Down Expand Up @@ -102,12 +97,8 @@ export default {
continuous: true,
},

sentry: {
dsn: process.env.SENTRY_DSN,
},

googleAnalytics: {
id: process.env.GA_ID,
appInsights: {
instrumentationKey: process.env.APP_INSIGHTS_CS,
},

// PWA module configuration: https://go.nuxtjs.dev/pwa
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@
"@fortawesome/free-brands-svg-icons": "5.15.4",
"@fortawesome/free-solid-svg-icons": "5.15.4",
"@nuxt/content": "1.15.1",
"@nuxtjs/applicationinsights": "2.0.10",
"@nuxtjs/dotenv": "1.4.2",
"@nuxtjs/fontawesome": "1.1.2",
"@nuxtjs/google-analytics": "2.4.0",
"@nuxtjs/pwa": "3.3.5",
"@nuxtjs/sentry": "3.3.1",
"@nuxtjs/sitemap": "2.4.0",
"bulma": "1.0.1",
"core-js": "3.37.1",
Expand Down

0 comments on commit 3d4f1ea

Please sign in to comment.