File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import rehypeMathjax from 'rehype-mathjax';
55import defaultSidebar from "./src/sidebars/defaultSidebar" ;
66import starlightLinksValidator from "starlight-links-validator" ;
77
8+ const googleAnalyticsId = 'G-63RJYNDBL1' ;
9+
810// https://astro.build/config
911export default defineConfig ( {
1012 site : "https://docs.dusk.network" ,
@@ -48,6 +50,26 @@ export default defineConfig({
4850 tableOfContents : { minHeadingLevel : 2 , maxHeadingLevel : 4 } ,
4951 sidebar : defaultSidebar ,
5052 plugins : [ starlightLinksValidator ( ) ] ,
53+ head : [
54+ // Adding google analytics
55+ {
56+ tag : 'script' ,
57+ attrs : {
58+ async : true ,
59+ src : `https://www.googletagmanager.com/gtag/js?id=${ googleAnalyticsId } ` ,
60+ } ,
61+ } ,
62+ {
63+ tag : 'script' ,
64+ content : `
65+ window.dataLayer = window.dataLayer || [];
66+ function gtag(){dataLayer.push(arguments);}
67+ gtag('js', new Date());
68+
69+ gtag('config', '${ googleAnalyticsId } ');
70+ ` ,
71+ } ,
72+ ] ,
5173 } ) ,
5274 ] ,
5375} ) ;
You can’t perform that action at this time.
0 commit comments