Yes, and I am only doing it for the count's benefit (and hopefully only for
now until we can update the castle to understand both /stories and /pieces)
- google analytics is a new property that gets the /stories/ urls.


On Fri, Mar 7, 2014 at 12:40 PM, Andrew Kuklewicz
<notifications@github.com>wrote:

> In src/common/angulartics-prx-count.js:
>
> > @@ -0,0 +1,96 @@
> > +(function (angular) {
> > +  angular.module('angulartics.prx.count', ['angulartics'])
> > +  .config(['$provide', function ($provide) {
> > +    $provide.decorator('$analytics', ['$delegate', '$window', function ($delegate, $window) {
> > +      var pageTrack = $delegate.pageTrack;
> > +      var eventTrack = $delegate.eventTrack;
> > +      var prefix = window.location.protocol + '//' + window.location.host;
> > +
> > +      $delegate.pageTrack = function (url) {
> > +        var remappedUrl = prefix + url.replace(/^\/stories/, '/pieces');
>
> I do something similar in the backend in a few places - nice that you only
> have to do the plural form.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/PRX/PRX.org-Frontend/pull/15/files#r10391465>
> .
>