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

Function adLogEvent

packages/shared/src/lib/feed.ts:187–210  ·  view source on GitHub ↗
(
  eventName: string,
  ad: Ad,
  opts?: {
    columns?: number;
    column?: number;
    row?: number;
    extra?: Record<string, unknown>;
  },
)

Source from the content-addressed store, hash-verified

185}
186
187export function adLogEvent(
188 eventName: string,
189 ad: Ad,
190 opts?: {
191 columns?: number;
192 column?: number;
193 row?: number;
194 extra?: Record<string, unknown>;
195 },
196): AdItemLogEvent {
197 return {
198 event_name: eventName,
199 feed_grid_columns: opts?.columns,
200 feed_item_grid_column: opts?.column,
201 feed_item_grid_row: opts?.row,
202 feed_item_image: ad.image,
203 feed_item_target_url: ad.link,
204 feed_item_title: ad.description,
205 ad_provider_id: ad.providerId,
206 target_id: ad.source,
207 target_type: 'ad',
208 extra: opts?.extra ? JSON.stringify(opts.extra) : undefined,
209 };
210}
211
212interface FeedHighlightsLogEventOptions extends FeedItemPosition {
213 feedName: string;

Callers 14

CommentAdFunction · 0.90
InlineAdFunction · 0.90
SidebarAdFunction · 0.90
onAdActionFunction · 0.90
FeedHeroFunction · 0.90
AdAsCommentFunction · 0.90
PostSidebarAdWidgetFunction · 0.90
SimilarSquadsListFunction · 0.90
useAdSlotActionsFunction · 0.90
useAdSlotFetchFunction · 0.90
logRefreshFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected