Andrea Vos 0a7ed699e8 lint
2025-03-30 16:07:44 +02:00

25 lines
709 B
TypeScript

export default defineNuxtPlugin(() => {
const config = useConfig();
if (!config.ads?.enabled || import.meta.env?.APP_ENV !== 'production') {
return;
}
useHead({
script: [
{
src: 'https://www.googletagmanager.com/gtag/js?id=G-TDJEP12Q3M',
async: true,
},
{
textContent: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-TDJEP12Q3M');
`,
type: 'text/javascript',
},
],
});
});