-
-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #320 from wasp-lang/miho-plausible-stats
opensaas.sh stats improvements
- Loading branch information
Showing
2 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
opensaas-sh/app_diff/src/analytics/providers/plausibleAnalyticsUtils.ts.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- template/app/src/analytics/providers/plausibleAnalyticsUtils.ts | ||
+++ opensaas-sh/app/src/analytics/providers/plausibleAnalyticsUtils.ts | ||
@@ -36,7 +36,7 @@ | ||
|
||
async function getTotalPageViews() { | ||
const response = await fetch( | ||
- `${PLAUSIBLE_BASE_URL}/v1/stats/aggregate?site_id=${PLAUSIBLE_SITE_ID}&metrics=pageviews`, | ||
+ `${PLAUSIBLE_BASE_URL}/v1/stats/aggregate?site_id=${PLAUSIBLE_SITE_ID}&metrics=pageviews&with_imported=true`, | ||
{ | ||
method: 'GET', | ||
headers: { | ||
@@ -80,7 +80,7 @@ | ||
} | ||
|
||
async function getPageviewsForDate(date: string) { | ||
- const url = `${PLAUSIBLE_BASE_URL}/v1/stats/aggregate?site_id=${PLAUSIBLE_SITE_ID}&period=day&date=${date}&metrics=pageviews`; | ||
+ const url = `${PLAUSIBLE_BASE_URL}/v1/stats/aggregate?site_id=${PLAUSIBLE_SITE_ID}&period=day&date=${date}&metrics=pageviews&with_imported=true`; | ||
const response = await fetch(url, { | ||
method: 'GET', | ||
headers: headers, | ||
@@ -93,7 +93,7 @@ | ||
} | ||
|
||
export async function getSources() { | ||
- const url = `${PLAUSIBLE_BASE_URL}/v1/stats/breakdown?site_id=${PLAUSIBLE_SITE_ID}&property=visit:source&metrics=visitors`; | ||
+ const url = `${PLAUSIBLE_BASE_URL}/v1/stats/breakdown?site_id=${PLAUSIBLE_SITE_ID}&property=visit:source&metrics=visitors&with_imported=true`; | ||
const response = await fetch(url, { | ||
method: 'GET', | ||
headers: headers, |