Skip to content

Commit

Permalink
feat(analytics): adjust track events
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa-thayto committed Feb 26, 2024
1 parent da14297 commit abaa5e6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,6 @@ export type SimplyticsTracker = {
declare global {
interface Window {
simplytics: SimplyticsTracker
umami: SimplyticsTracker
}
}
2 changes: 1 addition & 1 deletion src/components/BlogCard/BlogCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const BlogCard = ({
<Link
href={href}
onClick={() => {
window.simplytics.track('blog-card-clicked', {
window.umami.track('blog-card-clicked', {
name: 'blog-post-back-btn',
data: { href, title },
})
Expand Down
6 changes: 3 additions & 3 deletions src/pages/blog/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const PostPage = ({
<Link
href="/blog"
onClick={() => {
window.simplytics.track('blog-post-back-btn', {
window.umami.track('blog-post-back-btn', {
name: 'blog-post-back-btn',
data: {
title: prevPost.title,
Expand Down Expand Up @@ -135,7 +135,7 @@ const PostPage = ({
href={`/blog/${prevPost.slug}`}
className="py-8 px-10 text-center md:text-right first:rounded-t-lg md:first:rounded-tr-none md:first:rounded-l-lg last:rounded-r-lg first last:rounded-b-lg backdrop-blur-lg bg-slate-50 bg-opacity-100 dark:bg-opacity-10 hover:bg-opacity-30 dark:hover:bg-opacity-20 transition border border-gray-800 border-opacity-10 last:border-t md:border-r-0 md:last:border-r md:last:rounded-r-none flex flex-col"
onClick={() => {
window.simplytics.track('change-post-btn', {
window.umami.track('change-post-btn', {
name: 'blog-post-back-btn',
data: {
href: `/blog/${prevPost.slug}`,
Expand All @@ -158,7 +158,7 @@ const PostPage = ({
href={`/blog/${nextPost.slug}`}
className="py-8 px-10 text-center md:text-left md:first:rounded-t-lg last:rounded-b-lg first:rounded-l-lg md:last:rounded-bl-none md:last:rounded-r-lg backdrop-blur-lg bg-slate-50 bg-opacity-100 dark:bg-opacity-10 hover:bg-opacity-30 dark:hover:bg-opacity-20 transition border border-gray-800 border-opacity-10 border-t-0 first:border-t first:rounded-t-lg md:border-t border-b-0 last:border-b flex flex-col"
onClick={() => {
window.simplytics.track('change-post-btn', {
window.umami.track('change-post-btn', {
name: 'blog-post-back-btn',
data: {
href: `/blog/${nextPost.slug}`,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/linktree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const LinksPage = () => {
href={href}
className="flex justify-center font-medium cursor-pointer rounded-full border border-slate-900 hover:hover:bg-indigo-300 dark:hover:hover:bg-indigo-500 px-10 py-4 mb-4 text-slate-900 dark:text-gray-300 bg-white dark:bg-gray-600"
onClick={() => {
window.simplytics.track('linktree-button-clicked', {
window.umami.track('linktree-button-clicked', {
name: 'linktree-button-clicked',
data: {
href,
Expand Down

0 comments on commit abaa5e6

Please sign in to comment.