Skip to content

Commit 2effa62

Browse files
authored
Merge pull request #1453 from AppQuality/UN-1917
UN-1917 - add analytics hubspot
2 parents e2862ab + c00b1eb commit 2effa62

File tree

13 files changed

+29
-20
lines changed

13 files changed

+29
-20
lines changed

.env.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
REACT_APP_API_URL=https://dev.unguess.io/api
2-
REACT_APP_CROWD_WP_URL=https://dev.unguess.io
2+
REACT_APP_CROWD_WP_URL=https://dev.unguess.io

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"dependencies": {
66
"@analytics/google-tag-manager": "^0.6.0",
7+
"@analytics/hubspot": "^0.5.1",
78
"@appquality/languages": "1.4.3",
89
"@appquality/unguess-design-system": "4.0.50",
910
"@atlaskit/pragmatic-drag-and-drop": "^1.7.4",
@@ -129,4 +130,4 @@
129130
"*.{tsx,ts,js,css,md}": "prettier --write"
130131
},
131132
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
132-
}
133+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
declare module '@analytics/hubspot' {
2+
type AnalyticsPlugin = import('analytics').AnalyticsPlugin;
3+
4+
type HubspotConfig = {
5+
portalId: string;
6+
};
7+
8+
function hubspotPlugin(config: HubspotConfig): AnalyticsPlugin;
9+
export default hubspotPlugin;
10+
}

src/analytics.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import googleTagManager from '@analytics/google-tag-manager';
22
import Analytics from 'analytics';
3+
import hubspotPlugin from '@analytics/hubspot';
34
import userpilot from './common/analytics-plugins/userpilot';
45
import { isDev } from './common/isDevEnvironment';
56

@@ -17,6 +18,9 @@ const analytics = Analytics({
1718
userpilot({
1819
token: 'NX-54e88e10',
1920
}),
21+
hubspotPlugin({
22+
portalId: isDev() ? '50612068' : '6087279',
23+
}),
2024
],
2125
}),
2226
});

src/pages/Plan/context/planContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ export const PlanProvider = ({ children }: { children: ReactNode }) => {
9595
}
9696
} catch (error) {
9797
setIsPaymentInProgress(false);
98-
console.error(`Error while checkout process: ${error}`);
9998
}
10099
};
101100

src/pages/Plan/modals/DateInThePastAlertModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const DateInThePastAlertModal = ({ onQuit }: { onQuit: () => void }) => {
6666
.then(() => {
6767
navigate(window.location.pathname, { replace: true });
6868
})
69-
.catch((err) => {
69+
.catch(() => {
7070
addToast(
7171
({ close }) => (
7272
<Notification

src/pages/Plan/modules/Factory/modules/Literacy/Component.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
AccordionNew,
3-
Button,
43
Checkbox,
54
FormField,
65
Hint,

src/pages/Plan/modules/Factory/modules/OutOfScope/Component.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
Label,
77
SM,
88
Span,
9-
Textarea,
109
Tooltip,
1110
} from '@appquality/unguess-design-system';
1211
import { useState } from 'react';

src/pages/Plan/modules/Factory/modules/TargetSize/Component.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
AccordionNew,
33
Alert,
4-
Button,
54
FormField,
65
IconButton,
76
Input,

src/pages/Plan/useSetDraftOnFailed.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ export const useSetDraftOnFailed = () => {
5454
{ placement: 'top' }
5555
);
5656
})
57-
.catch((err) => {
58-
console.error(
59-
'Error updating plan status after payment failure',
60-
err
61-
);
57+
.catch(() => {
6258
navigate(notFoundRoute, { state: { from: location.pathname } });
6359
});
6460
};

0 commit comments

Comments
 (0)