mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Moved telemetry code to script.
This commit is contained in:
parent
3d7e9392f0
commit
a4a6888248
4 changed files with 25 additions and 11 deletions
14
pages/api/scripts/telemetry.js
Normal file
14
pages/api/scripts/telemetry.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { TELEMETRY_PIXEL } from 'lib/constants';
|
||||
|
||||
export default function handler(req, res) {
|
||||
const { v } = req.query;
|
||||
res.setHeader('content-type', 'text/javascript');
|
||||
res.send(
|
||||
`(() => {
|
||||
const i = document.createElement('img');
|
||||
i.setAttribute('src','${TELEMETRY_PIXEL}?v=${v}');
|
||||
i.setAttribute('style','width:0;height:0;position:absolute;pointer-events:none;');
|
||||
document.body.appendChild(i);
|
||||
})();`,
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue