diff --git a/services/web/frontend/js/infrastructure/event-tracking.js b/services/web/frontend/js/infrastructure/event-tracking.js index f71aab8d66..1c67b10aac 100644 --- a/services/web/frontend/js/infrastructure/event-tracking.js +++ b/services/web/frontend/js/infrastructure/event-tracking.js @@ -68,6 +68,7 @@ export const isSmallDevice = window.screen.width < 768 function sendBeacon(key, data) { if (!navigator || !navigator.sendBeacon) return + if (!getMeta('ol-ExposedSettings').isOverleaf) return data._csrf = getMeta('ol-csrfToken') const blob = new Blob([JSON.stringify(data)], { diff --git a/services/web/test/frontend/components/shared/start-free-trial-button.spec.tsx b/services/web/test/frontend/components/shared/start-free-trial-button.spec.tsx index 0320c6cb18..b0fa816819 100644 --- a/services/web/test/frontend/components/shared/start-free-trial-button.spec.tsx +++ b/services/web/test/frontend/components/shared/start-free-trial-button.spec.tsx @@ -1,4 +1,5 @@ import StartFreeTrialButton from '../../../../frontend/js/shared/components/start-free-trial-button' +import getMeta from '@/utils/meta' describe('start free trial button', function () { beforeEach(function () { @@ -8,6 +9,8 @@ describe('start free trial button', function () { cy.intercept('POST', '/event/paywall-click', { statusCode: 204, }).as('event-paywall-click') + + getMeta('ol-ExposedSettings').isOverleaf = true }) it('renders the button with default text', function () {