Skip to content

Commit

Permalink
chore: 更新google analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
imzbf committed Nov 14, 2024
1 parent f242dcd commit d328592
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 19 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,25 @@ export default defineNuxtConfig({
}
: {},

process.env.NODE_ENV === 'production'
? {
src: 'https://www.googletagmanager.com/gtag/js?id=G-3R6P1XE0H0',
async: true,
}
: {},

process.env.NODE_ENV === 'production'
? {
innerHTML: `window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-3R6P1XE0H0');`,
type: 'text/javascript',
}
: {},

process.env.NODE_ENV === 'production'
? {
innerHTML: `
Expand Down
1 change: 0 additions & 1 deletion public/robots.txt

This file was deleted.

0 comments on commit d328592

Please sign in to comment.