Skip to content

Commit 35f6048

Browse files
committed
Fire a view event only if the container has been personalised
1 parent cb460e6 commit 35f6048

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
@@ -7,6 +7,7 @@ import {
77
SvgChevronRightSingle,
88
} from '@guardian/source/react-components';
99
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
10+
import { submitComponentEvent } from '../client/ophan/ophan';
1011
import { getZIndex } from '../lib/getZIndex';
1112
import { isServer } from '../lib/isServer';
1213
import { ophanComponentId } from '../lib/ophan-helpers';
@@ -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)