Closed stefnoten closed 7 years ago
Yes, you're correct - that should be standardized. I would prefer if we added a helper function to get that value consistently or moved into the dispatchToGa function.
@timelf123 thoughts here? We could look at something upstream, set a "global" when pageTrack is called, or just copy the logic used upstream into a helper within the plugin. I'd lean towards 1 or 2, in case upstream changes occur further down the line. I think 2 is appropriate, although a bit hackey. 1 seems like the best approach to me at first brush.
2 seems fine to me but I'm down to extend the current core API too
For a pageTrack, the url is generated in the following way:
$analytics.settings.pageTracking.basePath + $location.url()
For an eventTrack however, the page url is generated in the following way:
properties.page || window.location.hash.substring(1) || window.location.pathname
This yields different results for the same page in Google Analytics. Shouldn't they be generated in the same way?