Skip to content

Commit 432a41d

Browse files
authored
Revert recent analytics updates (#935)
1 parent 35015a3 commit 432a41d

File tree

5 files changed

+58
-53
lines changed

5 files changed

+58
-53
lines changed

docs/.vuepress/client.ts

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "iconify-icon";
2+
import {onMounted} from "vue";
23
import type {RouteLocationNormalized} from "vue-router";
34
import {defineClientConfig, useRoute} from 'vuepress/client';
45
import CloudBanner from "./components/CloudBanner.vue";
@@ -120,50 +121,33 @@ export default defineClientConfig({
120121
addFixedRoute(`/clients/grpc/:pathMatch(.*)*`, "/clients/");
121122

122123
addDynamicRoute(`/clients/${clients}/latest/:pathMatch(.*)*`, to => {
123-
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions[0]
124-
if (!latestVersion?.version) {
125-
return `/clients/`;
126-
}
127-
return `/clients/${to.params.lang}/${latestVersion?.version}/${to.params.pathMatch}`;
124+
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions[0]
125+
return `/clients/${to.params.lang}/${latestVersion?.version}/${to.params.pathMatch}`;
128126
});
129127
addDynamicRoute(`/clients/${clients}/latest`, to => {
130-
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions?.[0];
131-
if (!latestVersion?.version || !latestVersion?.startPage) {
132-
return `/clients/`;
133-
}
134-
return `/clients/${to.params.lang}/${latestVersion.version}/${latestVersion.startPage}`;
128+
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions[0]
129+
return `/clients/${to.params.lang}/${latestVersion?.version}/${latestVersion?.startPage}`;
135130
});
136131
addDynamicRoute(`/clients/${clients}/legacy/:version`, to => {
137-
const version = to.params.version;
138-
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions.find(v => v.path === `legacy/${version}`)
139-
if (!latestVersion?.version || !latestVersion?.startPage) {
140-
return `/clients/`;
141-
}
142-
return `/clients/${to.params.lang}/legacy/${to.params.version}/${latestVersion?.startPage}`;
132+
const version = to.params.version;
133+
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions.find(v => v.path === `legacy/${version}`)
134+
return `/clients/${to.params.lang}/legacy/${to.params.version}/${latestVersion?.startPage}`;
143135
});
144136
addDynamicRoute(`/clients/${clients}/legacy`, to => {
145-
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions.find(v => v.path.startsWith('legacy/'))
146-
if (!latestVersion?.version || !latestVersion?.startPage) {
147-
return `/clients/`;
148-
}
149-
return `/clients/${to.params.lang}/${latestVersion?.path}/${latestVersion?.startPage}`;
137+
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions.find(v => v.path.startsWith('legacy/'))
138+
return `/clients/${to.params.lang}/${latestVersion?.path}/${latestVersion?.startPage}`;
150139
})
151140
addDynamicRoute(`/clients/${clients}/:version`, to => {
152-
const version = to.params.version;
153-
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions.find(v => v.path === version)
154-
if (!latestVersion?.version || !latestVersion?.startPage) {
155-
return `/clients/`;
156-
}
157-
return `/clients/${to.params.lang}/${version}/${latestVersion?.startPage}`;
141+
const version = to.params.version;
142+
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions.find(v => v.path === version)
143+
return `/clients/${to.params.lang}/${version}/${latestVersion?.startPage}`;
158144
});
159145
addDynamicRoute(`/clients/${clients}`, to => {
160-
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions[0]
161-
if (!latestVersion?.version || !latestVersion?.startPage) {
162-
return `/clients/`;
163-
}
164-
return `/clients/${to.params.lang}/${latestVersion?.path}/${latestVersion?.startPage}`;
146+
const latestVersion = __VERSIONS__.all.find(x => x.id === `${to.params.lang}-client`)?.versions[0]
147+
return `/clients/${to.params.lang}/${latestVersion?.path}/${latestVersion?.startPage}`;
165148
})
166149

150+
167151
// Add fixed routes for server versions because they don't use the same sidebar structure as the other versions
168152
addFixedRoute("/server/v22.10", "/server/v22.10/introduction.html");
169153
addFixedRoute("/server/v5", "/server/v5/introduction.html");
@@ -182,9 +166,10 @@ export default defineClientConfig({
182166
version: esData?.version,
183167
category: esData?.category,
184168
});
185-
if (window && window.posthog) {
169+
const a = window.analytics;
170+
if (a) {
186171
setTimeout(() => {
187-
window.posthog.capture('$pageview', {
172+
a.page({
188173
site: "docs",
189174
url: window.location.origin + to.fullPath,
190175
title: to.meta.t,
@@ -216,4 +201,11 @@ export default defineClientConfig({
216201
});
217202
router.beforeEach((to, from) => leave(to, from));
218203
},
204+
setup() {
205+
onMounted(() => {
206+
const route = useRoute();
207+
if (route.path !== "/") ;
208+
});
209+
210+
},
219211
});

docs/.vuepress/config.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ export default defineUserConfig({
7878
},
7979
theme: hopeTheme(themeOptions, {custom: true}),
8080
head: [
81+
// Business Institution 247, before the user accepts cookie
82+
['script', {
83+
type: 'text/javascript',
84+
src: 'https://secure.businessintuition247.com/js/264384.js',
85+
}],
86+
['noscript', {},
87+
'<img alt="" src="https://secure.businessintuition247.com/264384.png" style="display:none;" />'
88+
],
89+
8190
// Scarf
8291
['noscript', {},
8392
'<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=a2c83cb1-95a4-4437-91e2-ab0211cc0298" />'
@@ -87,9 +96,9 @@ export default defineUserConfig({
8796
['script', {
8897
id: 'Cookiebot',
8998
src: 'https://consent.cookiebot.com/uc.js',
90-
type: 'text/javascript',
9199
'data-cbid': 'ee971b30-e872-46e8-b421-706ef26d9dcc',
92100
'data-blockingmode': 'auto',
101+
type: 'text/javascript',
93102
}],
94103

95104
// Cookiebot declaration
@@ -100,12 +109,13 @@ export default defineUserConfig({
100109
async: true,
101110
}],
102111

112+
['script', {src: '/js/snippet.js'}],
113+
103114
// Business Institution 247 “consent‑only” loader
104115
['script', {
105-
src: 'https://secure.businessintuition247.com/js/sc/264384.js',
106116
type: 'text/plain',
107-
async: true,
108117
'data-cookiecategory': 'marketing',
118+
src: 'https://secure.businessintuition247.com/js/sc/264384.js',
109119
}],
110120

111121
// Kapa helper widget
@@ -117,14 +127,6 @@ export default defineUserConfig({
117127
'data-project-logo': '/logo-white.png'
118128
}],
119129

120-
// Reo
121-
['script', {
122-
src: "/js/reo.js",
123-
type: 'text/plain',
124-
async: true,
125-
'data-cookiecategory': 'marketing',
126-
}],
127-
128130
// CSS override to hide the modal mask and wrapper entirely
129131
['style', {}, `
130132
.redirect-modal-mask,

docs/.vuepress/lib/usePosthog.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import posthog from 'posthog-js';
33
export function usePostHog() {
44
try {
55
posthog.init('phc_DeHBgHGersY4LmDlADnPrsCPOAmMO7QFOH8f4DVEVmD', {
6-
api_host: 'https://phog.kurrent.io',
7-
capture_pageview: false
6+
api_host: 'https://phog.kurrent.io'
87
});
98
} catch (e) {
109
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(function () {
2+
if (typeof window === 'undefined') return;
3+
if (typeof window.signals !== 'undefined') return;
4+
var script = document.createElement('script');
5+
script.src = 'https://cdn.cr-relay.com/v1/site/da9bc552-0721-4931-aae9-9706006d2986/signals.js';
6+
script.async = true;
7+
window.signals = Object.assign(
8+
[],
9+
['page', 'identify', 'form'].reduce(function (acc, method) {
10+
acc[method] = function () {
11+
signals.push([method, arguments]);
12+
return signals;
13+
};
14+
return acc;
15+
}, {})
16+
);
17+
document.head.appendChild(script);
18+
})();

docs/.vuepress/public/js/reo.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)