Skip to content

Commit

Permalink
added tracking for tease play
Browse files Browse the repository at this point in the history
  • Loading branch information
okeino committed Nov 22, 2023
1 parent b2adefc commit c2f01cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/components/molecules/teaseRecording.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import IconPlay from '~public/img/icons/icon-play.svg';
import SuccessIcon from '~public/img/icons/icon-success-light.svg';
import { RecordingContentType } from '~src/__generated__/graphql';

import { analytics } from '../atoms/analytics';
import { TeaseRecordingFragment } from './__generated__/teaseRecording';
import ButtonFavorite from './buttonFavorite';
import { CardTheme } from './card/base/withCardTheme';
Expand Down Expand Up @@ -64,6 +65,13 @@ export default function TeaseRecording({
const progress = session.progress;
const [personsExpanded, setPersonsExpanded] = useState(false);

const trackTeasePlay = () => {
analytics.track('Tease Play', {
Id: recording.id,
Recording: recording.title,
});
};

const index = recording.sequenceIndex;
const count = recording.sequence?.recordings.aggregate?.count;

Expand Down Expand Up @@ -149,6 +157,7 @@ export default function TeaseRecording({
onClick={(e) => {
e.preventDefault();
session.play();
trackTeasePlay();
}}
color={isDarkTheme ? BaseColors.WHITE : BaseColors.DARK}
backgroundColor={backgroundColor}
Expand Down

0 comments on commit c2f01cd

Please sign in to comment.