Skip to content

add track delivery metric#112

Closed
eserra wants to merge 4 commits into
customerio:mainfrom
stepful:es/add-metrics-endpoint
Closed

add track delivery metric#112
eserra wants to merge 4 commits into
customerio:mainfrom
stepful:es/add-metrics-endpoint

Conversation

@eserra
Copy link
Copy Markdown

@eserra eserra commented Feb 18, 2024

The /push/events endpoint is deprecated in favor of the /metrics endpoint

This PR implements track_delivery_metric to leverage the new endpoint

Note that the validation of the parameters depends on the channel of the delivery, which is unknown at runtime

@eserra eserra marked this pull request as draft February 18, 2024 23:02
@eserra eserra marked this pull request as ready for review February 18, 2024 23:50
hownowstephen added a commit that referenced this pull request May 8, 2026
* Add track_delivery_metric for /api/v1/metrics endpoint

Adds support for reporting delivery metrics (opened, clicked,
converted, delivered, bounced, deferred, dropped, spammed) via the
new /api/v1/metrics endpoint, replacing the deprecated /push/events
endpoint.

Based on community PR #112 by @eserra with fixes for:
- valid_url? bug that passed boolean instead of URL string
- .present? usage (Rails-only, unavailable in plain Ruby)
- Breaking constant renames (PUSH_* constants preserved)
- Inconsistent attribute handling (now uses symbolize_keys/slice)

* Remove PUSH_* constants, use DELIVERY_* for VALID_PUSH_EVENTS

PUSH_OPENED/PUSH_CONVERTED/PUSH_DELIVERED were duplicates of
DELIVERY_OPENED/DELIVERY_CONVERTED/DELIVERY_DELIVERED. Consolidate
to a single set of constants.

* Fix rubocop: use single quotes inside string interpolation

* Add back PUSH_* constants as deprecated aliases

Preserves backwards compatibility for anyone referencing
PUSH_OPENED, PUSH_CONVERTED, or PUSH_DELIVERED directly.
@hownowstephen
Copy link
Copy Markdown
Contributor

closing in favour of #139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants