Skip to content

Move trackPageview() from navigate() to loadUrl() #7

@mitio

Description

@mitio

In one project of mine I needed to move the trackPageiew() call from the overridden version of Backbone.History#navigate() to Backbone.History#loadUrl(). That was needed because in this project I don't call navigate() 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, because navigate() 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions