Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Google Analytics #1615

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion integration/src/test/resources/access-app.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ services.api.url=http://localhost:48080/services/api/

fuseki.baseUri=http://localhost:48080

google.trackingId=
matomo.authToken=
matomo.api.url=
matomo.site.id=5
Expand Down
21 changes: 6 additions & 15 deletions static/js/vue-cdr-access/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion static/js/vue-cdr-access/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"lodash.sortby": "^4.7.0",
"nouislider": "^15.6.1",
"vue": "^3.2.47",
"vue-gtag": "^2.0.1",
"vue-i18n": "^9.2.2",
"vue-router": "^4.1.6",
"vuex": "^4.1.0"
Expand Down
10 changes: 1 addition & 9 deletions static/js/vue-cdr-access/src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createApp, h } from 'vue'
import { createI18n } from 'vue-i18n'
import { createHead, VueHeadMixin } from "@vueuse/head"
import VueGtag from 'vue-gtag';
import App from './App.vue'
import router from './router'
import store from './store'
Expand All @@ -24,8 +23,6 @@ if (document.getElementById('app') !== null && window.dcr_browse_records === und
}
});

const gaCode = import.meta.env.VITE_GA_CODE || '';

// Set this here as it gives a build error otherwise
window.matomoSiteSrcUrl = import.meta.env.VITE_MATOMO_SITE_SRC_URL || '';

Expand All @@ -37,10 +34,5 @@ if (document.getElementById('app') !== null && window.dcr_browse_records === und
.use(head)
.use(store)
.use(router)
.use(i18n)
.use(VueGtag, {
config: {
id: gaCode
}
}).mount('#app');
.use(i18n).mount('#app');
}
17 changes: 0 additions & 17 deletions static/js/vue-cdr-access/src/mixins/analyticsUtils.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
export default {
methods: {
pageEvent(recordData) {
this.$gtag.event('record', {
'event_category': recordData.briefObject.parentCollectionId,
'event_label': `${recordData.briefObject.title}|${recordData.briefObject.id}`
});
this.matomoPageEvent(recordData);
},

matomoPageEvent(recordData) {
let collection = recordData.briefObject.parentCollectionName || '';
if (collection === '' && recordData.briefObject.type === 'Collection') {
collection = recordData.briefObject.title;
Expand All @@ -29,15 +21,6 @@ export default {
},

pageView(title) {
this.$gtag.pageview({
page_title: `Digital Collections Repository - ${title}`,
page_path: this.$route.path,
page_location: window.location.href
});
this.matomoPageView(title)
},

matomoPageView(title) {
window._mtm = window._mtm || [];
window._mtm.push({
event: 'pageViewEvent',
Expand Down
4 changes: 0 additions & 4 deletions static/js/vue-cdr-access/tests/fixtures/testHelpers.js

This file was deleted.

2 changes: 0 additions & 2 deletions static/js/vue-cdr-access/tests/unit/aboutRepository.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {createI18n} from "vue-i18n";
import translations from "@/translations";
import store from '@/store';
import moxios from "moxios";
import { $gtag } from '../fixtures/testHelpers';

let wrapper, router;

Expand Down Expand Up @@ -38,7 +37,6 @@ describe('aboutRepository.vue', () => {
wrapper = shallowMount(aboutRepository, {
global: {
plugins: [i18n, router, store],
mocks: { $gtag },
stubs: {
RouterLink: RouterLinkStub
}
Expand Down
2 changes: 0 additions & 2 deletions static/js/vue-cdr-access/tests/unit/advancedSearch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {createI18n} from "vue-i18n";
import translations from "@/translations";
import store from '@/store';
import moxios from "moxios";
import { $gtag } from '../fixtures/testHelpers';

let wrapper, router;

Expand Down Expand Up @@ -38,7 +37,6 @@ describe('advancedSearch.vue', () => {
wrapper = shallowMount(advancedSearch, {
global: {
plugins: [i18n, router, store],
mocks: { $gtag },
stubs: {
RouterLink: RouterLinkStub
}
Expand Down
4 changes: 1 addition & 3 deletions static/js/vue-cdr-access/tests/unit/analyticsUtils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import analyticsUtils from "../../src/mixins/analyticsUtils";
import store from '@/store';
import { createI18n } from "vue-i18n";
import translations from "@/translations";
import { $gtag } from '../fixtures/testHelpers';
import moxios from "moxios";

let wrapper;
Expand Down Expand Up @@ -44,7 +43,6 @@ describe('analyticsUtils', () => {
wrapper = mount(advancedSearch, {
global: {
plugins: [router, store, i18n],
mocks: { $gtag },
stubs: {
RouterLink: RouterLinkStub
}
Expand Down Expand Up @@ -145,7 +143,7 @@ describe('analyticsUtils', () => {
wrapper = mount(displayWrapper, {
global: {
plugins: [store, i18n],
mocks: { $gtag, $route },
mocks: { $route },
stubs: {
RouterLink: RouterLinkStub
}
Expand Down
2 changes: 0 additions & 2 deletions static/js/vue-cdr-access/tests/unit/displayWrapper.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import moxios from "moxios";
import {createI18n} from "vue-i18n";
import translations from "@/translations";
import { response, briefObjectData } from "../fixtures/displayWrapperFixtures";
import { $gtag } from '../fixtures/testHelpers';

let wrapper, router;

Expand Down Expand Up @@ -45,7 +44,6 @@ describe('displayWrapper.vue', () => {
wrapper = mount(displayWrapper, {
global: {
plugins: [router, store, i18n],
mocks: { $gtag },
stubs: {
RouterLink: RouterLinkStub
}
Expand Down
2 changes: 0 additions & 2 deletions static/js/vue-cdr-access/tests/unit/frontPage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {createI18n} from "vue-i18n";
import translations from "@/translations";
import store from '@/store';
import moxios from "moxios";
import { $gtag } from '../fixtures/testHelpers';

let wrapper, router;

Expand Down Expand Up @@ -38,7 +37,6 @@ describe('frontPage.vue', () => {
wrapper = shallowMount(frontPage, {
global: {
plugins: [i18n, router, store],
mocks: { $gtag },
stubs: {
RouterLink: RouterLinkStub
}
Expand Down
2 changes: 0 additions & 2 deletions static/js/vue-cdr-access/tests/unit/matomoUtils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import displayWrapper from '@/components/displayWrapper.vue';
import store from '@/store';
import { createI18n } from "vue-i18n";
import translations from "@/translations";
import { $gtag } from '../fixtures/testHelpers';


let wrapper;
Expand Down Expand Up @@ -44,7 +43,6 @@ describe('matomoUtils', () => {
attachTo: '#root',
global: {
plugins: [router, store, i18n],
mocks: { $gtag },
stubs: {
RouterLink: RouterLinkStub
}
Expand Down
2 changes: 0 additions & 2 deletions static/js/vue-cdr-access/tests/unit/searchWrapper.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import moxios from "moxios";
import displayWrapper from "@/components/displayWrapper.vue";
import {createI18n} from "vue-i18n";
import translations from "@/translations";
import { $gtag } from '../fixtures/testHelpers';

const response = {
"container": {
Expand Down Expand Up @@ -141,7 +140,6 @@ describe('searchWrapper.vue', () => {
wrapper = shallowMount(searchWrapper, {
global: {
plugins: [router, i18n],
mocks: { $gtag }
}
});

Expand Down
2 changes: 0 additions & 2 deletions static/service-unavailable.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="shortcut icon" href="/static/images/favicon.ico" type="image/x-icon">
<link href="https://www.googletagmanager.com" rel="preconnect">
<script async="" src="https://www.googletagmanager.com/gtag/js?id=&amp;l=dataLayer"></script>
<title>Digital Collections Repository - Page Unavailable</title>
<base href="https://dcr.lib.unc.edu/">
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
</bean>

<bean id="analyticsTracker" class="edu.unc.lib.boxc.web.common.utils.AnalyticsTrackerUtil">
<property name="gaTrackingID" ref="gaTrackingID" />
<property name="solrSearchService" ref="unrestrictedSolrSearchService" />
<property name="httpClientConnectionManager" ref="httpClientConnectionManager" />
<property name="repositoryHost" value="${repository.host}" />
<property name="matomoAuthToken" value="${matomo.authToken}" />
<property name="matomoApiURL" value="${matomo.api.url}" />
<property name="matomoSiteID" value="${matomo.site.id}" />
Expand Down
4 changes: 0 additions & 4 deletions web-access-app/src/main/webapp/WEB-INF/service-context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@

<!-- Beans -->

<bean id="gaTrackingID" class="java.lang.String">
<constructor-arg value="${google.trackingId}" />
</bean>

<bean id="accessBaseUrl" class="java.lang.String">
<constructor-arg value="${access.base.url}" />
</bean>
Expand Down
Loading
Loading