mgonto / angularytics

The solution to tracking page views and events in a SPA with AngularJS
MIT License
630 stars 70 forks source link

Add AngularyticsProvider.setPageChangeEvent() #11

Closed ggoodman closed 11 years ago

ggoodman commented 11 years ago

Enables the customization of the page change event that is used to automatically generate page view events. This is important for use in ui-router and perhaps other alternatives to default angular routing.

AngularyticsProvider.setPageChangeEvent("$stateChangeSuccess");
mgonto commented 11 years ago

Hey,

First of all, thanks for the contribution.

$locationChangeSuccess will be there even if you use ui-router, and it'll be called on URL change. If you want to use this $stateChangeSuccess it'd mean that on every state change, even thoguh there's no URL change, a PageView will be tracked, so changing state would actually send 2 page views to the same URL maybe.

Why are you proposing this? Is that what you want to achieve?

Thanks!

mgonto commented 11 years ago

I agree on mergint this as it's even MORE configurable than before, but take what I said into account for setting the right event to track.

mgonto commented 11 years ago

Thanks!