Skip to content

Commit b108976

Browse files
committed
Fire a view event only if the container has been personalised
1 parent 10b6ba4 commit b108976

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { useAB } from '../lib/useAB';
1919
import { palette } from '../palette';
2020
import type { DCRFrontCard } from '../types/front';
2121
import { HighlightsCard } from './Masthead/HighlightsCard';
22+
import { submitComponentEvent } from '../client/ophan/ophan';
2223

2324
type Props = {
2425
trails: DCRFrontCard[];
@@ -344,6 +345,18 @@ export const ScrollableHighlights = ({ trails, frontId }: Props) => {
344345
}
345346
/* Otherwise, use personalised order from local storage */
346347
setOrderedTrails(personalisedHighlights);
348+
349+
/* Fire a view event only if the container has been personalised */
350+
void submitComponentEvent(
351+
{
352+
component: {
353+
componentType: 'CONTAINER',
354+
id: `reordered-highlights-container`,
355+
},
356+
action: 'VIEW',
357+
},
358+
'Web',
359+
);
347360
}, [trails]);
348361

349362
const { ophanComponentLink, ophanComponentName, ophanFrontName } =

0 commit comments

Comments
 (0)