Skip to content

Commit 6d4f14d

Browse files
authored
Add linkTo prop to LoopVideo for navigation tracking on first view event. (#14397)
1 parent 09081a2 commit 6d4f14d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

dotcom-rendering/src/components/Card/Card.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,7 @@ export const Card = ({
895895
fallbackImageLoading={imageLoading}
896896
fallbackImageAlt={media.imageAltText}
897897
fallbackImageAspectRatio="5:4"
898+
linkTo={linkTo}
898899
/>
899900
</Island>
900901
)}

dotcom-rendering/src/components/LoopVideo.importable.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ type Props = {
116116
fallbackImageLoading: CardPictureProps['loading'];
117117
fallbackImageAlt: CardPictureProps['alt'];
118118
fallbackImageAspectRatio: CardPictureProps['aspectRatio'];
119+
linkTo: string;
119120
};
120121

121122
export const LoopVideo = ({
@@ -130,6 +131,7 @@ export const LoopVideo = ({
130131
fallbackImageLoading,
131132
fallbackImageAlt,
132133
fallbackImageAspectRatio,
134+
linkTo,
133135
}: Props) => {
134136
const adapted = useShouldAdapt();
135137
const { renderingTarget } = useConfig();
@@ -333,6 +335,7 @@ export const LoopVideo = ({
333335
component: {
334336
componentType: 'LOOP_VIDEO',
335337
id: `gu-video-loop-${atomId}`,
338+
labels: [linkTo],
336339
},
337340
action: 'VIEW',
338341
},
@@ -341,7 +344,7 @@ export const LoopVideo = ({
341344

342345
setHasBeenInView(true);
343346
}
344-
}, [isInView, hasBeenInView, atomId]);
347+
}, [isInView, hasBeenInView, atomId, linkTo]);
345348

346349
/**
347350
* Handle play/pause, when instigated by the browser.

0 commit comments

Comments
 (0)