File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { defineConfig } from 'astro/config' ;
2
2
import starlightLinksValidator from 'starlight-links-validator' ;
3
3
import starlight from '@astrojs/starlight' ;
4
-
4
+ const googleAnalyticsId = 'G-FPWQ35ME85' ;
5
5
6
6
export default defineConfig ( {
7
7
site : "https://rcac-bioinformatics.github.io" ,
@@ -28,6 +28,25 @@ export default defineConfig({
28
28
}
29
29
}
30
30
] ,
31
+ head : [
32
+ // Adding google analytics
33
+ {
34
+ tag : 'script' ,
35
+ attrs : {
36
+ src : `https://www.googletagmanager.com/gtag/js?id=${ googleAnalyticsId } ` ,
37
+ } ,
38
+ } ,
39
+ {
40
+ tag : 'script' ,
41
+ content : `
42
+ window.dataLayer = window.dataLayer || [];
43
+ function gtag(){dataLayer.push(arguments);}
44
+ gtag('js', new Date());
45
+
46
+ gtag('config', '${ googleAnalyticsId } ');
47
+ ` ,
48
+ } ,
49
+ ] ,
31
50
logo : {
32
51
light : './src/assets/logo-light.png' ,
33
52
dark : './src/assets/logo-dark.png' ,
You can’t perform that action at this time.
0 commit comments