maxandriani / ngx-google-analytics

An easy way to use and configure Google Analytics on Angular 6+ applications
MIT License
120 stars 49 forks source link

Events should be able to send any information #97

Open avmesquita opened 2 years ago

avmesquita commented 2 years ago

Events are now given a value as a number.

It would be nice if events were given any value so that you can, for example, send the events as default add_to_cart, purchase, view_item, etc. (https://support.google.com/analytics/answer/9267735#online-sales)

hakimio commented 1 year ago

You can provide any additional params in the options argument:

this.gaService.event('event_name', 'some_category', 'some_label', {
    customDimension: 'foo_bar'
});

This usage is a bit more intuitive in my updated package (@hakimio/ngx-google-analytics): https://github.com/hakimio/ngx-google-analytics#register-analytics-events