Skip to content

Commit

Permalink
Add support for Plausible analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Oct 9, 2024
1 parent d626ea9 commit 02b9459
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ These instructions assume that you have a postgres database set up.
"Discord": "local",
"Server": "local"
},
"Plausible": {
// This is the domain for the plausible analytics, you can set this to your own domain if you want to track analytics
"Snippet": "<script ...>", // This will go into the head of every page
"Enabled": true,
}
}
```

Expand Down
12 changes: 11 additions & 1 deletion ReplayBrowser/Pages/Shared/Layout/App.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<!DOCTYPE html>
@inject IConfiguration Configuration

@{
var plausibleSnippet = new MarkupString(Configuration["Plausible:Snippet"]);

Check warning on line 4 in ReplayBrowser/Pages/Shared/Layout/App.razor

View workflow job for this annotation

GitHub Actions / deploy

Possible null reference argument for parameter 'value' in 'MarkupString.MarkupString(string value)'.

Check warning on line 4 in ReplayBrowser/Pages/Shared/Layout/App.razor

View workflow job for this annotation

GitHub Actions / deploy

Possible null reference argument for parameter 'value' in 'MarkupString.MarkupString(string value)'.
}

<!DOCTYPE html>
<html lang="en" data-bs-theme="dark" data-enhance-nav="false">

<head>
Expand All @@ -14,6 +20,10 @@
<link rel="icon" type="image/png" href="favicon.png"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<meta name="robots" content="noindex">
@if(Configuration["Plausible:Enabled"] == "True")
{
@plausibleSnippet
}

<script src="_framework/blazor.web.js" autostart="false"></script>

Expand Down

0 comments on commit 02b9459

Please sign in to comment.