Skip to content

Commit ec74e8b

Browse files
authored
Add Google Analytics tracking code (#66)
This commit introduces Google Analytics tracking to both `App.razor` and `index.html`. It includes a script to load the Google Tag Manager library asynchronously and initializes tracking with the ID `G-5PEH6MERND`, enabling the collection of user interaction data. NOTE: This commit message is auto-generated using GitHub Copilot.
1 parent a94b4a4 commit ec74e8b

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

  • BlazorExpress.Bulma.Demo.Server/Components
  • BlazorExpress.Bulma.Demo.WebAssembly/wwwroot

BlazorExpress.Bulma.Demo.Server/Components/App.razor

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" />
1515
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
1616
<link rel="stylesheet" href="BlazorExpress.Bulma.Demo.Server.styles.css" />
17+
18+
<!-- Google tag (gtag.js) -->
19+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5PEH6MERND"></script>
20+
<script>
21+
window.dataLayer = window.dataLayer || [];
22+
function gtag(){dataLayer.push(arguments);}
23+
gtag('js', new Date());
24+
25+
gtag('config', 'G-5PEH6MERND');
26+
</script>
27+
1728
<HeadOutlet @rendermode="InteractiveServer" />
1829
</head>
1930

BlazorExpress.Bulma.Demo.WebAssembly/wwwroot/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@
1313
<link rel="stylesheet" href="_content/BlazorExpress.Bulma.Demo.RCL/css/blazorexpress.bulma.demo.rcl.css" asp-append-version="true" />
1414
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" />
1515
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
16+
17+
<!-- Google tag (gtag.js) -->
18+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5PEH6MERND"></script>
19+
<script>
20+
window.dataLayer = window.dataLayer || [];
21+
function gtag() { dataLayer.push(arguments); }
22+
gtag('js', new Date());
23+
24+
gtag('config', 'G-5PEH6MERND');
25+
</script>
1626
</head>
1727

1828
<body>

0 commit comments

Comments
 (0)