Open mitio opened 12 years ago
I don't know how I let this slip and I sincerely apologize. I will take a look at your suggestion as soon as possible (hopefully sometime this week) and let you know what my thoughts are.
I just need to regain context, since I feel like what you bring up has come up previously, but I cannot remember off the top of my head and I can't investigate further at this moment.
So sorry about the 6 months delay and thanks for the input :bomb:
In one project of mine I needed to move the
trackPageiew()
call from the overridden version ofBackbone.History#navigate()
toBackbone.History#loadUrl()
. That was needed because in this project I don't callnavigate()
manually. I just let the location hash change drive the navigation.If only the hash changes,
navigate()
is not called and thus nothing is tracked. On the other hand,loadUrl()
is called always, becausenavigate()
calls it internally and I think that it might be a good idea to move the page tracking call there.What do you think about this?
I can send you a PR with the changes if you think it's a good idea.