Skip to content

Commit

Permalink
Added Umami analytics and download tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
PHLAK committed Nov 26, 2024
1 parent fe69127 commit cc9cf27
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/components/download.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="container max-w-4xl mx-auto px-4 py-12 flex flex-col justify-between items-center text-center lg:px-0">
<div>
@foreach ($release->assets as $asset)
<a href="{{ $asset->browser_download_url }}" onclick="gtag('event', 'click', { 'event_category': 'Download', 'event_label': '{{ $asset->name }}' });"
<a href="{{ $asset->browser_download_url }}" data-umami-event="download" data-umami-event-version="{{ $release->tag_name }}" data-umami-event-asset="{{ $asset->name }}"
class="inline-block rounded-lg bg-blue-600 shadow my-2 px-6 py-4 text-lg text-white w-full transform transition hover:scale-105 hover:shadow-md sm:w-auto sm:mx-2 sm:my-0"
>
<i class="fas fa-download fa-lg fa-fw"></i> Download
Expand Down
2 changes: 2 additions & 0 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
</div>

@stack('scripts')

@includeWhen(app()->isProduction(), 'partials.analytics')
1 change: 1 addition & 0 deletions resources/views/partials/analytics.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script defer src="https://analytics.phlak.net/script.js" data-website-id="23fea9c6-c39e-44ce-bada-5a74c2d207a7"></script>

0 comments on commit cc9cf27

Please sign in to comment.