Solved

How do you exclude specific characters from a hash filter?

  • 12 August 2022
  • 4 replies
  • 131 views

Userlevel 1
Badge

We have a single page application, and want to be able to identify page views for the main page vs subpages, and we have the following kind of hash structure for the main page:

  • app#xyz ← this is the main page
  • app#xyz/browse/* ← the hash if you navigate back to the main page from a filter or a subpage

And then the subpages look like:

  • app#xyz/new/*
  • app#xyz/12345

It seems easy to set up a filter on the hash to include the two hashes for the main page, and straightforward how to exclude the first of the subpage hashes, but is it possible to exclude the second (e.g., a wildcard that contains only numbers)?

icon

Best answer by Christy H 17 August 2022, 00:28

View original

4 replies

Userlevel 4
Badge +3

Hey Amanda, the wildcard * character is fully supported in all types of events in Heap.

You can use the wildcard character as a placeholder for any and all values in an event definition.

For example, let’s say that you wanted to create an event for viewing an order page but that order page URL contains unique IDs as seen below

If the order page URL is: https://brand.com/12345678/orders/36293a8fde7e760f30aae48521935dd0


Then the corresponding event definition would use */orders/* to capture the two unique IDs.

This image has an empty alt attribute; its file name is wildcards-order-page.png

Hopefully this helps!

Userlevel 4
Badge +3

If event definition isn’t the problem and you are looking to group your results you may want to explore defined properties as a solution.

Userlevel 5
Badge +4

Another way to do this is to use the “Hash” property. 

 

e.g. doing an equality for your main page

 

then for navigation within your app use a wildcard:

 

Userlevel 5
Badge +4

Oops realized a mistake in my example, You should use a “View Page” not “Click on”. Rest of the example for filtering stands.

Reply