ember-metrics icon indicating copy to clipboard operation
ember-metrics copied to clipboard

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

Open moekify opened this issue 3 years ago • 0 comments

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)

moekify avatar Mar 10 '21 13:03 moekify