Opened 22 months ago

Closed 14 months ago

Last modified 14 months ago

#3232 closed New feature (fixed)

Page URLs reports: allow to aggregate Hash tag values

Reported by: acollier21 Owned by: capedfuzz
Priority: normal Milestone: 1.11 - Piwik 1.11
Component: Core Keywords: ajax, hashtag, hash, hash value
Cc: Sensitive: no

Description (last modified by matt)

This is the original post here :,90224


I hope I'm not missing anything, but I thought I'd post something in here before I went crazy. I have built an AJAX application that relies on hash tags to navigate through the page. We need to keep track of each of the individual hash tags, but the only report I'm aware of that shows the pages that a user has visited is logging in to the Piwik Dashboard and going to Actions>Pages. I've attached two screenshots to help show my point. One is of the Piwik interface and you can see one of the files (2551-0.php) is the only page in it. The second screenshot shows my database and the log_action table showing that there are different hash tags being recorded for 2551-0.php.

My question is if I'm missing something and need to set a preference somewhere to show all the different hash tags within a given page, or if this is a (un)known issue that has(n't) been addressed.

Response by matt:

you are right this is an issue that hasn't been dealt with yet. What happens is that we record the pages with the hash, but then at archiving time, we actually aggregate on the URLs without the hash.

we could probably easily allow to keep the hash values and show stats for each hashvalue. please create a ticket if you want this

Attachments (2)

Screen Shot 2012-06-12 at 2.33.53 PM.png (21.7 KB) - added by acollier21 22 months ago.
Screen Shot 2012-06-12 at 2.33.32 PM.png (26.8 KB) - added by acollier21 22 months ago.

Download all attachments as: .zip

Change History (16)

Changed 22 months ago by acollier21

Changed 22 months ago by acollier21

comment:1 Changed 22 months ago by matt (mattab)

  • Description modified (diff)
  • Milestone set to 1.x - Piwik 1.x
  • Summary changed from Unable to view specific hash tag parameters for AJAX application to Page URLs reports: allow to aggregate Hash tag values

There are several ways we could deal with this issue:

  • Configuration file setting "piwik wide" to enable "Keep Hash tag values in the Page URLs"
  • We could add a per-website setting "Keep Hash tag values in page Urls"
  • Provide a Javascript function allowHashTags() that would forward the hash tags only if called -- otherwise the JS and PHP tracker would remove hash tags.

Also see this interesting post for a use case of tracking with hash tags:

comment:2 Changed 22 months ago by acollier21

If I could offer my opinion, in my case, this would be great as a global setting. I have about 700 sites (and climbing) that are using this hashtag feature.

comment:3 Changed 20 months ago by matt (mattab)

  • Milestone changed from 1.x - Piwik 1.x to 1.8.4 - Piwik 1.8.4
  • Owner set to capedfuzz

Alternatively we could also have a setting "Disable hash tags" which could be enabled by default, where hash tags are used for campaigns tracking (eg. #pk_campign=X&pk_kwd=Y), but are removed before being recorded in log_action.

Let's do this new default setting (disabled hash tag, default is disabled, when enabled it will track each hash tag as different pageview).

comment:4 Changed 19 months ago by EZdesign (BeezyT)

I think it's important to be consistent between the actions report and the database. This means that when hash tags are enabled, they should be recorded in the DB and shown in the pages report. When they are disabled, they should be included in neither of them.

comment:5 Changed 19 months ago by matt (mattab)

(In [7113])
Refs #3332

  • Transition works for Page titles with hierarchy (eg "$Category / $name")
  • URL metadata:
    • is only available on non Summary rows.
    • It is now set to the page with highest number of visits, when page names do overwrite.
  • However now, by default we do track keep hash tags and we do not aggregate them in one page URL.
    • Refs #3232 Will be nice to have, to allow to "not track fragment" by default. See stub processUrlFragment(). More to do: Admin UI, Tests w/ and wo/ hash tags, w/ Capital letter in hostname
    • URL being tracked, and URL read from the logs (for backward compatibility) are now cleaned: hostname is lowered, and URL Fragment is kept/removed.

comment:6 Changed 19 months ago by matt (mattab)

Here is a proposal spec:

  • New Global setting "Remove hash tags from the Page URL"
    • By default, we will remove all hash tags as of the release containing this fix
  • Each website by default use the global setting, but can overwrite and change the value.
    • Below the textarea "Excluded parameters" is the new setting
    • DB: a site has a new column "url_fragment" with values 0 (use default), 1 (keep fragment), 2 (delete fragment). Update sets all sites to 0 to use default (ie. remove all hash tags).

comment:7 Changed 14 months ago by capedfuzz (diosmosis)

  • Resolution set to fixed
  • Status changed from new to closed

In ac59017af362e0f1069722df1677f31ac49a3707:

Fixes #3232, add ability to discard URL fragments when tracking for all websites or for just some websites.

comment:8 Changed 14 months ago by Fabian Becker

In 306903417533764104be0a18540b6194da923708:

Fixing test failure regression introduced in previous commit.

refs #3232

comment:10 Changed 14 months ago by matt (mattab)

Code review

  • Nice commit, I like your naming choices & General Setting UI.
  • for this preference, a new column is not necessary as most users don't need to change the default. So I suggest instead to add, below the tooltip of the "URLs" columns, the following:

Keep Page URL fragments when tracking Page URLs [ No (default) ]

SELECT values are eg.

  • No (default)
  • Yes
  • No

This way the setting is not very visible (good because it's not used often) and it does not add more horizontal scrolling.

Last edited 14 months ago by matt (previous) (diff)

comment:11 Changed 14 months ago by matt (mattab)

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:12 Changed 14 months ago by capedfuzz (diosmosis)

  • Resolution set to fixed
  • Status changed from reopened to closed

In da85ebe6a3ab6133e4c598f6600befbd4a3dc6e5:

Fixes #3232, remove keep url fragments column in website table and move to under URLs column in edit mode.

comment:13 Changed 14 months ago by matt (mattab)


  • I think this new label change + "Default (No)" will help understanding the feature better: Keep Page URL fragments when tracking Page URLs [ No (default) ]
Note: See TracTickets for help on using tickets.