MCPcopy Create free account
hub / github.com/dailydotdev/apps / feedHighlightsLogEvent

Function feedHighlightsLogEvent

packages/shared/src/lib/feed.ts:187–227  ·  view source on GitHub ↗
(
  eventName: string,
  {
    action,
    columns,
    column,
    row,
    feedName,
    ranking,
    count,
    clickedHighlight,
    highlightIds,
    feedMeta,
    position,
    origin,
  }: FeedHighlightsLogEventOptions,
)

Source from the content-addressed store, hash-verified

185}
186
187export function feedHighlightsLogEvent(
188 eventName: string,
189 {
190 action,
191 columns,
192 column,
193 row,
194 feedName,
195 ranking,
196 count,
197 clickedHighlight,
198 highlightIds,
199 feedMeta,
200 position,
201 origin,
202 }: FeedHighlightsLogEventOptions,
203): FeedItemLogEvent {
204 return {
205 event_name: eventName,
206 feed_grid_columns: columns,
207 feed_item_grid_column: column,
208 feed_item_grid_row: row,
209 feed_item_meta: feedMeta ?? undefined,
210 feed_item_target_url: clickedHighlight?.post.commentsPermalink,
211 feed_item_title: clickedHighlight?.headline,
212 target_type: TargetType.HighlightsCard,
213 extra: JSON.stringify({
214 ...feedLogExtra(feedName, ranking, undefined, origin).extra,
215 ...(action ? { action } : {}),
216 ...(typeof count === 'number' ? { count } : {}),
217 ...(typeof position === 'number' ? { position } : {}),
218 ...(highlightIds?.length ? { highlight_ids: highlightIds } : {}),
219 ...(clickedHighlight
220 ? {
221 clicked_highlight_id: clickedHighlight.id,
222 post_id: clickedHighlight.post.id,
223 }
224 : {}),
225 }),
226 };
227}
228
229export interface GetDefaultFeedProps {
230 hasFiltered?: boolean;

Callers 5

FeedItemComponentFunction · 0.90
onHighlightClickFunction · 0.90
onReadAllClickFunction · 0.90
useLogImpressionFunction · 0.90

Calls 1

feedLogExtraFunction · 0.85

Tested by

no test coverage detected