Skip to content

Commit

Permalink
Add Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
misike12 committed Oct 11, 2024
1 parent 53dcd6e commit e2a8d79
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ export default defineConfig({
[ 'meta', { name: 'twitter:image', content: '/assets/images/title.webp' }],
[ 'meta', { name: 'twitter:site', content: '@openmproject' }],
[ 'meta', { name: 'twitter:creator', content: '@openmproject' }],
//Google Analytics
[
'script',
{ async: '', src: 'https://www.googletagmanager.com/gtag/js?id=GTM-5ZZ37QC7' } //[!code focus]
],
[
'script',
{},
`window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GTM-5ZZ37QC7');` //[!code focus]
],

//Google AdSense
[
"script",
{
"data-ad-client": "YOURCLIENTID like ca-pub-3798***", //[!code focus]
async: '',
src: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",
},
],
],

themeConfig: {
Expand Down

0 comments on commit e2a8d79

Please sign in to comment.