adopted-ember-addons / adopted-ember-addons/ember-metrics

Wanting to use an adapter that isn't defined does not throw an error

Đang mở
#275 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
367
Fork
158
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi!

First of, thanks for creating such a great add-on that makes implementation of tracking/metrics solutions very straightforward.

For our use-case we had to extend an existing adapter (`GoogleTagManager` GTM) to add some additional params so our consent solution would work in a GDPR conform manner. The whole extending is very straightforward and works out of the box.

As part of this extension we removed the setup of the standard GTM adapter in the environment file and replaced it with setting up our custom adapter. However, what we did not do is replace all our `this.metrics.trackEvent` calls that were still pointing to the "original" GTM adapter and not our custom one. In the end, we turned off tracking accidentally this way.

After we identified the issue it was simple to resolve, however we were wondering if it would be beneficial if in these cases ember metrics would throw any kind of error. E.g. Adapter not defined, missing params for this adapter, or similar

Currently, it just seems to be silently failing in the background or were we missing something entirely?

Curious to discuss and happy to supply more information if needed.

## Summary

### Problem
No errors when an adapter is used with trackEvent that isn't defined

### Proposed Solution
Throw some error, potentially with more information why the adapter in question can't work (or trackEvent does not work because adapter isn't defined)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.