Skip to content

Commit bb796b7

Browse files
committed
add trial click
1 parent f613293 commit bb796b7

File tree

6 files changed

+32
-102
lines changed

6 files changed

+32
-102
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"@algolia/autocomplete-preset-algolia": "1.17.9",
2121
"@algolia/client-abtesting": "5.18.0",
2222
"@algolia/client-analytics": "5.18.0",
23-
"@algolia/client-insights": "^5.30.0",
2423
"@algolia/client-personalization": "5.18.0",
2524
"@algolia/client-query-suggestions": "5.18.0",
2625
"@algolia/client-search": "5.18.0",
@@ -151,7 +150,6 @@
151150
"repeat-string": "1.6.1",
152151
"sass": "^1.44.0",
153152
"sass-loader": "^12.4.0",
154-
"search-insights": "^2.17.3",
155153
"serve-handler": "6.1.6",
156154
"shelljs": "^0.9.0",
157155
"snake-case": "3.0.4",

src/components/SearchConversionTracker.js

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

src/pages/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import SumoLogicDocsLogo from '../../static/img/sumo-logic-docs.svg';
99
import { Feature } from '../components/Feature';
1010
import { features } from '../helper/features';
1111
import ErrorBoundary from '../components/ErrorBoundary';
12-
import SearchConversionTracker from '../components/SearchConversionTracker';
1312

1413
export const Home = () => {
1514
const [tab, setTab] = useState('0');
@@ -20,7 +19,6 @@ export const Home = () => {
2019
description='Sumo Logic docs - real-time alerting, security, dashboards, and machine-learning-powered analytics for all three types of telemetry — logs, metrics, and traces.'
2120
title='Home'
2221
>
23-
<SearchConversionTracker />
2422
{/* Header */}
2523
<Typography
2624
bgcolor='#0045BE'

src/theme/DocSearch/Hit/index.js

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

static/track-trial-click.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
(function () {
2+
document.addEventListener('DOMContentLoaded', function () {
3+
const trialBtn = document.querySelector('.header-trial');
4+
5+
if (!trialBtn) return;
6+
7+
trialBtn.addEventListener('click', () => {
8+
fetch('https://insights.algolia.io/1/events', {
9+
method: 'POST',
10+
headers: {
11+
'Content-Type': 'application/json',
12+
'X-Algolia-API-Key': 'fb2f4e1fb40f962900631121cb365549',
13+
'X-Algolia-Application-Id': '2SJPGMLW1Q'
14+
},
15+
body: JSON.stringify({
16+
events: [
17+
{
18+
eventName: 'Start Free Trial Clicked',
19+
eventType: 'conversion',
20+
index: 'crawler_sumodocs',
21+
objectIDs: ['trial-button-static'], // static dummy ID
22+
userToken: 'docusaurus-user'
23+
}
24+
]
25+
})
26+
})
27+
.then(res => res.json())
28+
.then(console.log)
29+
.catch(console.error);
30+
});
31+
});
32+
})();

yarn.lock

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@
7979
resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-5.27.0.tgz#290b9d0922c5a7162f6e322357a0d0a8565b939a"
8080
integrity sha512-tnFOzdNuMzsz93kOClj3fKfuYoF3oYaEB5bggULSj075GJ7HUNedBEm7a6ScrjtnOaOtipbnT7veUpHA4o4wEQ==
8181

82-
"@algolia/[email protected]":
83-
version "5.30.0"
84-
resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-5.30.0.tgz#fa7b03095e90f7fef2d1786baec278e7125b0740"
85-
integrity sha512-tbUgvkp2d20mHPbM0+NPbLg6SzkUh0lADUUjzNCF+HiPkjFRaIW3NGMlESKw5ia4Oz6ZvFzyREquUX6rdkdJcQ==
86-
8782
"@algolia/[email protected]":
8883
version "5.27.0"
8984
resolved "https://registry.yarnpkg.com/@algolia/client-insights/-/client-insights-5.27.0.tgz#6c270ed1c01c72c23af5832ae0ce6fe69df59958"
@@ -94,16 +89,6 @@
9489
"@algolia/requester-fetch" "5.27.0"
9590
"@algolia/requester-node-http" "5.27.0"
9691

97-
"@algolia/client-insights@^5.30.0":
98-
version "5.30.0"
99-
resolved "https://registry.yarnpkg.com/@algolia/client-insights/-/client-insights-5.30.0.tgz#e2bd9e2e4984f2e68dc6c1f881fcd3834cd9b23f"
100-
integrity sha512-caXuZqJK761m32KoEAEkjkE2WF/zYg1McuGesWXiLSgfxwZZIAf+DljpiSToBUXhoPesvjcLtINyYUzbkwE0iw==
101-
dependencies:
102-
"@algolia/client-common" "5.30.0"
103-
"@algolia/requester-browser-xhr" "5.30.0"
104-
"@algolia/requester-fetch" "5.30.0"
105-
"@algolia/requester-node-http" "5.30.0"
106-
10792
"@algolia/[email protected]":
10893
version "5.18.0"
10994
resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-5.18.0.tgz#26128f6a1aef523ae32f29ef9afd18fd2f159b98"
@@ -243,13 +228,6 @@
243228
dependencies:
244229
"@algolia/client-common" "5.27.0"
245230

246-
"@algolia/[email protected]":
247-
version "5.30.0"
248-
resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.30.0.tgz#a006ed06e910b33d750173ad86feb3ca2ede1a4c"
249-
integrity sha512-alo3ly0tdNLjfMSPz9dmNwYUFHx7guaz5dTGlIzVGnOiwLgIoM6NgA+MJLMcH6e1S7OpmE2AxOy78svlhst2tQ==
250-
dependencies:
251-
"@algolia/client-common" "5.30.0"
252-
253231
"@algolia/[email protected]":
254232
version "5.18.0"
255233
resolved "https://registry.yarnpkg.com/@algolia/requester-fetch/-/requester-fetch-5.18.0.tgz#fcccc76bd7d16fb54c56d15baa6b5f657b17ca71"
@@ -264,13 +242,6 @@
264242
dependencies:
265243
"@algolia/client-common" "5.27.0"
266244

267-
"@algolia/[email protected]":
268-
version "5.30.0"
269-
resolved "https://registry.yarnpkg.com/@algolia/requester-fetch/-/requester-fetch-5.30.0.tgz#a118448b51ce20f703aca706709a1196dada2a28"
270-
integrity sha512-WOnTYUIY2InllHBy6HHMpGIOo7Or4xhYUx/jkoSK/kPIa1BRoFEHqa8v4pbKHtoG7oLvM2UAsylSnjVpIhGZXg==
271-
dependencies:
272-
"@algolia/client-common" "5.30.0"
273-
274245
"@algolia/[email protected]":
275246
version "5.18.0"
276247
resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-5.18.0.tgz#c5b16de53d83276067583e7b2f56b09eac938435"
@@ -285,13 +256,6 @@
285256
dependencies:
286257
"@algolia/client-common" "5.27.0"
287258

288-
"@algolia/[email protected]":
289-
version "5.30.0"
290-
resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-5.30.0.tgz#607f827b09da78bc2300d02e137fbbbeed11f1d3"
291-
integrity sha512-uSTUh9fxeHde1c7KhvZKUrivk90sdiDftC+rSKNFKKEU9TiIKAGA7B2oKC+AoMCqMymot1vW9SGbeESQPTZd0w==
292-
dependencies:
293-
"@algolia/client-common" "5.30.0"
294-
295259
"@ampproject/remapping@^2.2.0":
296260
version "2.3.0"
297261
resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.3.0.tgz#ed441b6fa600072520ce18b43d2c8cc8caecc7f4"
@@ -12495,11 +12459,6 @@ schema-utils@^4.0.0, schema-utils@^4.0.1, schema-utils@^4.3.0, schema-utils@^4.3
1249512459
ajv-formats "^2.1.1"
1249612460
ajv-keywords "^5.1.0"
1249712461

12498-
search-insights@^2.17.3:
12499-
version "2.17.3"
12500-
resolved "https://registry.yarnpkg.com/search-insights/-/search-insights-2.17.3.tgz#8faea5d20507bf348caba0724e5386862847b661"
12501-
integrity sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==
12502-
1250312462
section-matter@^1.0.0:
1250412463
version "1.0.0"
1250512464
resolved "https://registry.yarnpkg.com/section-matter/-/section-matter-1.0.0.tgz#e9041953506780ec01d59f292a19c7b850b84167"

0 commit comments

Comments
 (0)