Skip to content

Commit

Permalink
add analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
nirtamir2 committed Oct 10, 2023
1 parent cc62e34 commit 0be5a61
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions website/src/components/Card.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ interface Props {
title: string;
body: string;
href: string;
download: string;
}
const { href, title, body } = Astro.props;
---
const { href, title, download, body } = Astro.props;
---
<li class="link-card">
<a href={href}>
<a href={href} download={download}>
<h2>
{title}
<span>&larr;</span>
Expand All @@ -19,6 +20,15 @@ const { href, title, body } = Astro.props;
</p>
</a>
</li>
<script is:inline>
const linkDownload = document.querySelector('.link-card');
linkDownload.addEventListener('click', () => {
window.gtag('event', 'file_download', {
'event_category' : 'send-to',
'event_label' : href
})
});
</script>
<style>
.link-card {
list-style: none;
Expand Down

0 comments on commit 0be5a61

Please sign in to comment.