Browse Source

Inyectar red de espionaje masivo

prod
Nulo 5 months ago
parent
commit
d898082e88
  1. 7
      README.md
  2. 1
      package.json
  3. 6
      pnpm-lock.yaml
  4. 25
      vite.config.js

7
README.md

@ -22,3 +22,10 @@ pnpm run format
```
pnpm run build
```
### Google Tag Manager
Para compilar con Google Tag Manager, usá la variable `TRACKEAR_A_LXS_USUARIXS`:
```
TRACKEAR_A_LXS_USUARIXS=ID_DE_TAG_MANAGER pnpm run build
```

1
package.json

@ -11,6 +11,7 @@
},
"devDependencies": {
"@types/howler": "^2.2.3",
"@types/node": "^16.0.1",
"@vitejs/plugin-legacy": "^1.4.3",
"prettier": "2.3.2",
"typescript": "^4.3.5",

6
pnpm-lock.yaml

@ -2,6 +2,7 @@ lockfileVersion: 5.3
specifiers:
'@types/howler': ^2.2.3
'@types/node': ^16.0.1
'@vitejs/plugin-legacy': ^1.4.3
howler: ^2.2.3
prettier: 2.3.2
@ -13,6 +14,7 @@ dependencies:
devDependencies:
'@types/howler': 2.2.3
'@types/node': 16.0.1
'@vitejs/plugin-legacy': 1.4.3_vite@2.4.1
prettier: 2.3.2
typescript: 4.3.5
@ -29,6 +31,10 @@ packages:
resolution: {integrity: sha512-rzIE56NmGh7t8LdZT/zuBMa9iZvwqVmB65gNhwNLtrGEIHdWkEDp1fVmoM/zctR4UJZFe0uP01AmPuPzOwhecA==}
dev: true
/@types/node/16.0.1:
resolution: {integrity: sha512-hBOx4SUlEPKwRi6PrXuTGw1z6lz0fjsibcWCM378YxsSu/6+C30L6CR49zIBKHiwNWCYIcOLjg4OHKZaFeLAug==}
dev: true
/@vitejs/plugin-legacy/1.4.3_vite@2.4.1:
resolution: {integrity: sha512-lxZUJaMWYMQuqvZM1wPzDP6KABQgA/drVL5fnaygEPcz9adc2OHhfFNN/SvvHQ1V0rP8gybIc7uA+iI1gAdkVQ==}
engines: {node: '>=12.0.0'}

25
vite.config.js

@ -5,5 +5,30 @@ export default {
legacy({
targets: ["defaults", "not IE 11"],
}),
{
name: "google-tag-manager",
transformIndexHtml() {
if (process.env.TRACKEAR_A_LXS_USUARIXS) {
const id = process.env.TRACKEAR_A_LXS_USUARIXS;
return [
{
tag: "script",
attrs: {
src: "https://www.googletagmanager.com/gtag/js?id=" + id,
async: true,
},
},
{
tag: "script",
children: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${id}');`,
},
];
} else return [];
},
},
],
};

Loading…
Cancel
Save