Skip to content

Commit

Permalink
use plural resource name for file-download and outbound-link-click ev…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
negrel committed Dec 10, 2024
1 parent d33ab7a commit 222f818
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/handlers/events_file_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
type PostEventsFileDownload fiber.Handler

// ProvidePostEventsFileDownload is a wire provider for POST
// /api/v1/events/file-download handler.
// /api/v1/events/file-downloads handler.
func ProvidePostEventsFileDownload(
eventStore eventstore.Service,
saltManagerService saltmanager.Service,
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/events_outbound_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
type PostEventsOutboundLink fiber.Handler

// ProvidePostEventsOutboundLink is a wire provider for POST
// /api/v1/events/outbound-link handler.
// /api/v1/events/outbound-links handler.
func ProvidePostEventsOutboundLink(
eventStore eventstore.Service,
saltManagerService saltmanager.Service,
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/noscript_outbound_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
type GetNoscriptEventsOutboundLink fiber.Handler

// ProvideGetNoscriptEventsOutboundLink is a wire provider for
// GET /api/v1/noscript/events/outbound-link handler.
// GET /api/v1/noscript/events/outbound-links handler.
func ProvideGetNoscriptEventsOutboundLink(
eventStore eventstore.Service,
sessionStorage sessionstorage.Service,
Expand Down
6 changes: 3 additions & 3 deletions pkg/wired/fiber.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ func ProvideFiber(
app.Post("/api/v1/events/custom/:name", fiber.Handler(postCustomEventHandler))
app.Get("/api/v1/noscript/events/custom/:name", fiber.Handler(getNoscriptCustomEventHandler))

app.Post("/api/v1/events/outbound-link", fiber.Handler(postOutboundLinkEventHandler))
app.Get("/api/v1/noscript/events/outbound-link", fiber.Handler(getNoscriptOutboundLinkEventHandler))
app.Post("/api/v1/events/outbound-links", fiber.Handler(postOutboundLinkEventHandler))
app.Get("/api/v1/noscript/events/outbound-links", fiber.Handler(getNoscriptOutboundLinkEventHandler))

app.Post("/api/v1/events/file-download", fiber.Handler(postFileDownloadEventHandler))
app.Post("/api/v1/events/file-downloads", fiber.Handler(postFileDownloadEventHandler))

return app
}
6 changes: 3 additions & 3 deletions tests/bun/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export const PRISME_PAGEVIEWS_URL = PRISME_API_URL + '/events/pageviews'
export const PRISME_NOSCRIPT_PAGEVIEWS_URL = PRISME_API_URL + '/noscript/events/pageviews'
export const PRISME_CUSTOM_EVENTS_URL = PRISME_API_URL + '/events/custom'
export const PRISME_NOSCRIPT_CUSTOM_EVENTS_URL = PRISME_API_URL + '/noscript/events/custom'
export const PRISME_OUTBOUND_LINK_EVENTS_URL = PRISME_API_URL + '/events/outbound-link'
export const PRISME_NOSCRIPT_OUTBOUND_LINK_EVENTS_URL = PRISME_API_URL + '/noscript/events/outbound-link'
export const PRISME_FILE_DOWNLOAD_EVENTS_URL = PRISME_API_URL + '/events/file-download'
export const PRISME_OUTBOUND_LINK_EVENTS_URL = PRISME_API_URL + '/events/outbound-links'
export const PRISME_NOSCRIPT_OUTBOUND_LINK_EVENTS_URL = PRISME_API_URL + '/noscript/events/outbound-links'
export const PRISME_FILE_DOWNLOAD_EVENTS_URL = PRISME_API_URL + '/events/file-downloads'

export const PRISME_METRICS_URL = PRISME_ADMIN_URL + '/metrics'

Expand Down
4 changes: 2 additions & 2 deletions tracker/web_analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@
}

// Send event.
sendClickEvent("/outbound-link", url).finally(followLink)
sendClickEvent("/outbound-links", url).finally(followLink)
}

// File downloads.
if (trackFileDownloads && anchor.getAttribute("download") !== null) {
return sendClickEvent("/file-download", url)
return sendClickEvent("/file-downloads", url)
}
}

Expand Down

0 comments on commit 222f818

Please sign in to comment.