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

Function feedHighlightsLogEvent

packages/shared/src/lib/feed.ts:194–234  ·  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

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