Skip to content

Commit

Permalink
disable plausible event proxy (#301)
Browse files Browse the repository at this point in the history
Disables plausible proxy when sending data to the event API that was
missed in #295
  • Loading branch information
codemonkey800 authored Dec 21, 2023
1 parent a09a101 commit 35385af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion frontend/packages/data-portal/app/hooks/usePlausible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export type EventPayloads = {
}
}

// TODO Fix proxying for plausible
// const PLAUSIBLE_EVENT_API = '/api/event'
const PLAUSIBLE_EVENT_API = 'https://plausible.io/api/event'

export function usePlausible() {
const { ENV, LOCALHOST_PLAUSIBLE_TRACKING } = useEnvironment()

Expand Down Expand Up @@ -101,7 +105,7 @@ export function usePlausible() {
}

// eslint-disable-next-line @typescript-eslint/no-floating-promises
axios.post('/api/event', payload, {
axios.post(PLAUSIBLE_EVENT_API, payload, {
headers: {
'Content-Type': 'application/json',
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/data-portal/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const Document = withEmotionCache(
<script
defer
data-domain={PLAUSIBLE_ENV_URL_MAP[ENV.ENV]}
// TODO Fix proxying
// TODO Fix proxying for plausible
// src="/plausible.js"
src={getPlausibleUrl({
hasLocalhostTracking: ENV.LOCALHOST_PLAUSIBLE_TRACKING === 'true',
Expand Down

0 comments on commit 35385af

Please sign in to comment.