Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track the wrong url for an url containing a hash #8763

Closed
dhoko opened this issue Sep 11, 2015 · 4 comments
Closed

Track the wrong url for an url containing a hash #8763

dhoko opened this issue Sep 11, 2015 · 4 comments
Labels
worksforme The issue cannot be reproduced and things work as intended.

Comments

@dhoko
Copy link

dhoko commented Sep 11, 2015

Hi,

I'm using piwik with a webapp (Angular). I wanted to track pages but it didn't work.

Some urls:

  • foo.bar/#/home
  • foo.bar/#/search
  • foo.bar/#/login
  • foo.bar/#/login/register

With the dashboard Actions > Pages, I found only one url: /index 😕

The JS:

page: () => {
  console.log('Page url', location.href, arguments)
  tracker.setCustomUrl(location.href);
  tracker.trackPageView.apply(tracker, arguments);
},

I tested with this:

tracker.setCustomUrl(escape(location.href));
tracker.setCustomUrl(encodeURIComponent(location.href));

but it didn't work too.

To make it works, I have to remove the #.

page: () => {
  console.log('Page url', location.href, arguments)
  tracker.setCustomUrl(location.href.replace('/#/', '/'));
  tracker.trackPageView.apply(tracker, arguments);
},

Then I can find my pages as expected.

@mattab
Copy link
Member

mattab commented Sep 14, 2015

Hi @dhoko

I just tested and it works for me fine with tracker.setCustomUrl(location.href);

See how it looks in reports:

pages

visitor log:

visitor log

@mattab mattab closed this as completed Sep 14, 2015
@mattab mattab added the worksforme The issue cannot be reproduced and things work as intended. label Sep 14, 2015
@dhoko
Copy link
Author

dhoko commented Sep 15, 2015

It still doesn't work. We were with the 2.14.2, with the 2.14.3 nop it still doesn't work.

@RMastop
Copy link
Contributor

RMastop commented Sep 15, 2015

Hi @dhoko,

Just to be sure..

Did you enable "Keep Page URL fragments when tracking Page URLs" like this FAQ shows:
http://piwik.org/faq/how-to/faq_188/

@dhoko
Copy link
Author

dhoko commented Sep 15, 2015

It works ! \o/

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

3 participants