mirror of
https://github.com/techno-tim/littlelink-server.git
synced 2024-11-22 05:25:13 +01:00
Add Plausible Analytics (#391)
* Add PLAUSIBLE_URL and PLAUSIBLE_DATA_DOMAIN Plausible's tags look like this: <script defer data-domain="domain.com" src="https://plausible.io/js/script.js"></script> If you are using their hosted version the PLAUSIBLE_URL=plausible.io, otherwise you can use your self-hosted url here. * Add Plausible script tag * Added PLAUSIBLE_DATA_API * Remove "/script.js" hardcoded path and add PLAUSIBLE_DATA_API * lint fix --------- Co-authored-by: Techno Tim <timothystewart6@gmail.com>
This commit is contained in:
parent
e684a5411b
commit
ab2b06c5af
20726
package-lock.json
generated
Normal file
20726
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -125,6 +125,9 @@ export const runtimeConfig =
|
||||
MYANIMELIST: window?.env?.MYANIMELIST,
|
||||
MATOMO_URL: window?.env?.MATOMO_URL,
|
||||
MATOMO_SITE_ID: window?.env?.MATOMO_SITE_ID,
|
||||
PLAUSIBLE_URL: window?.env?.PLAUSIBLE_URL,
|
||||
PLAUSIBLE_DATA_API: window?.env?.PLAUSIBLE_DATA_API,
|
||||
PLAUSIBLE_DATA_DOMAIN: window?.env?.PLAUSIBLE_DATA_DOMAIN,
|
||||
SHARE: window?.env?.SHARE,
|
||||
DROP_SHADOW: window?.env?.DROP_SHADOW,
|
||||
FIVEHUNDREDPX: window?.env?.FIVEHUNDREDPX,
|
||||
@ -456,6 +459,15 @@ export const runtimeConfig =
|
||||
MATOMO_SITE_ID: nodeIsProduction
|
||||
? process.env.MATOMO_SITE_ID
|
||||
: process.env.RAZZLE_MATOMO_SITE_ID,
|
||||
PLAUSIBLE_URL: nodeIsProduction
|
||||
? process.env.PLAUSIBLE_URL
|
||||
: process.env.RAZZLE_PLAUSIBLE_URL,
|
||||
PLAUSIBLE_DATA_API: nodeIsProduction
|
||||
? process.env.PLAUSIBLE_DATA_API
|
||||
: process.env.RAZZLE_PLAUSIBLE_DATA_API,
|
||||
PLAUSIBLE_DATA_DOMAIN: nodeIsProduction
|
||||
? process.env.PLAUSIBLE_DATA_DOMAIN
|
||||
: process.env.RAZZLE_PLAUSIBLE_DATA_DOMAIN,
|
||||
SHARE: nodeIsProduction ? process.env.SHARE : process.env.RAZZLE_SHARE,
|
||||
DROP_SHADOW: nodeIsProduction
|
||||
? process.env.DROP_SHADOW
|
||||
|
@ -227,6 +227,16 @@ server
|
||||
<!-- Matomo End -->`
|
||||
: ''
|
||||
}
|
||||
${
|
||||
runtimeConfig.PLAUSIBLE_DATA_DOMAIN &&
|
||||
runtimeConfig.PLAUSIBLE_DATA_API &&
|
||||
runtimeConfig.PLAUSIBLE_URL
|
||||
? `
|
||||
<!-- Plausible Analytics -->
|
||||
<script async defer data-domain="${runtimeConfig.PLAUSIBLE_DATA_DOMAIN}" data-api="${runtimeConfig.PLAUSIBLE_DATA_API}" src="${runtimeConfig.PLAUSIBLE_URL}">
|
||||
</script>`
|
||||
: ''
|
||||
}
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
Loading…
Reference in New Issue
Block a user