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

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

Aperta
#275 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
367
Fork
158
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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)

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.