Closed ghost closed 4 years ago
hm, can you explain what you want to achieve?
at the moment the tracker is only available in the controller layer, because there you have access to the request env. The actual tracking happens by rendering the javascript tracking snippet in the view.
What do you expect to happen in a model? 🤔
I have an e-commerce flow being handled in a service and want to send data to GA
You could calculate everything needed in the service and give everything to the tracker block in the controller so that the view can render the corresponding javascript. 🤷♂
If you want to track directly in your services, I believe then you might want to use their API directly and not the JS Snippet.
Getting undefined method `tracker'