修改cspbug和换了新的gtmid

This commit is contained in:
frankkeres 2025-04-24 14:27:30 +08:00
parent 12ccaad5f9
commit df9c74ba16

View File

@ -6,7 +6,7 @@ export default {
title: 'buddysCloud', title: 'buddysCloud',
script: [ script: [
{ {
src: 'https://www.googletagmanager.com/gtag/js?id=G-PMXV6BN06E', src: 'https://www.googletagmanager.com/gtag/js?id=G-KNJFL438C1',
async: true, async: true,
}, },
{ {
@ -14,7 +14,7 @@ export default {
window.dataLayer = window.dataLayer || []; window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);} function gtag(){dataLayer.push(arguments);}
gtag('js', new Date()); gtag('js', new Date());
gtag('config', 'G-PMXV6BN06E'); gtag('config', 'G-KNJFL438C1');
`, `,
type: 'text/javascript', type: 'text/javascript',
}, },
@ -72,7 +72,7 @@ export default {
// '@nuxtjs/google-analytics' // '@nuxtjs/google-analytics'
// ], // ],
gtm: { gtm: {
id: 'GTM-PL75JP66', id: 'GTM-5M5JNS4K',
layer: 'dataLayer', layer: 'dataLayer',
pageTracking: false, // ✅ 关闭 GTM 的自动页面跟踪,避免和 GA 冲突 pageTracking: false, // ✅ 关闭 GTM 的自动页面跟踪,避免和 GA 冲突
enabled: true enabled: true
@ -87,5 +87,13 @@ export default {
// }, // },
// Build Configuration: https://go.nuxtjs.dev/config-build // Build Configuration: https://go.nuxtjs.dev/config-build
build: { build: {
},
render: {
csp: {
policies: {
'script-src': ["'self'", "'unsafe-eval'"],
// 其他策略...
}
}
} }
} }