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

Fix live NEXT_PUBLIC_ENV #212

Merged
merged 1 commit into from
Oct 24, 2023
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
4 changes: 2 additions & 2 deletions src/config/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ const config = {
if (isBrowser && !firebase.apps.length) {
firebase.initializeApp(config);

if (process.env.NEXT_PUBLIC_ENV === 'production') {
if (process.env.NEXT_PUBLIC_ENV === 'live') {
try {
disableGoogleAnalyticsAdSignals();
const analyticsInstance = firebase.analytics();
analyticsInstance.setAnalyticsCollectionEnabled(shouldEnableAnalytics());
} catch (error) {
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console
console.error('Failed to initialise analytics', error);
rollbar.error('Failed to initialise analytics', error);
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function App({ Component, pageProps }) {
router.push('/sign-in');
}
if (
process.env.NEXT_PUBLIC_ENV === 'production' &&
process.env.NEXT_PUBLIC_ENV === 'live' &&
getCookieConsentValue('ConsentToCookie') === 'true'
) {
hotjar.identify('USER_ID', { userProperty: user.id });
Expand All @@ -129,7 +129,7 @@ function App({ Component, pageProps }) {
setIsLoading(false);
});

if (process.env.NEXT_PUBLIC_ENV === 'production') {
if (process.env.NEXT_PUBLIC_ENV === 'live') {
hotjar.initialize(Number(process.env.NEXT_PUBLIC_HOTJAR_ID), 5);
}
}, []);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/analyticsEvent.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import firebase from '../config/firebase';

export default function analyticsEvent(event, params) {
if (process.env.NEXT_PUBLIC_ENV === 'production') {
if (process.env.NEXT_PUBLIC_ENV === 'live') {
firebase.analytics().logEvent(event, params);
}
}
Loading