Skip to content

Commit

Permalink
check amount of clicks on cards
Browse files Browse the repository at this point in the history
  • Loading branch information
saphal-upreti committed Jul 16, 2024
1 parent 0d98e03 commit 89e6f18
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nepalingo-web/src/components/card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';

import ReactGA from 'react-ga4';
const Card: React.FC<{
Word: string;
TranslatedWord: string;
Expand All @@ -8,6 +8,14 @@ const Card: React.FC<{
ImageUrl?: string;
PronounciationUrl?: string;
}> = ({ Word, TranslatedWord, Pronunciation, DevenagiriSpelling, ImageUrl, PronounciationUrl }) => {
// Send a custom event
ReactGA.event({
category: "card components",
action: "Click",
value: 99, // optional, must be a number
nonInteraction: true, // optional, true/false
transport: "xhr", // optional, beacon/xhr/image
});
const [isFlipped, setIsFlipped] = useState(false);
const [audio, setAudio] = useState<HTMLAudioElement | null>(null);

Expand Down

0 comments on commit 89e6f18

Please sign in to comment.