angulartics / angulartics-google-analytics

Google Analytics plugin for Angulartics
MIT License
133 stars 86 forks source link

eventTrack() Custom Dimensions are set on the Tracker and are therefore sent with every subsequent event. #37

Closed northsoul70 closed 8 years ago

northsoul70 commented 8 years ago

A change was made in 9898229 which sets each custom dimension/metric on the Tracker:

ga('set', 'dimension' + idx.toString(), properties['dimension' + idx.toString()]);

This causes every subsequent event to also contain those custom dimensions/metrics (even if they are set up as 'hit' scope). Previously 'send' had been used rather than 'set'.
This seems like the wrong default behavior for the eventTrack() function.

timelf123 commented 8 years ago

What is the desired behavior here? I'm happy to review a PR.

Change set to send?

DanWilkerson commented 8 years ago

@timelf123 CD's should passed as an object to the send command when the event fires. I'm hoping to put a PR on this Saturday or Sunday.

timelf123 commented 8 years ago

Thanks @northsoul70 for catching this bug!

@DanWilkerson when you dive into this will you take a look at https://github.com/angulartics/angulartics-google-analytics/issues/33 ? I assume this will be a nonissue if we are no longer hooking $analytics.setUserProperties.

DanWilkerson commented 8 years ago

@timelf123 yup, on it