Why is my Regex include filter not working (google analytics)?

156 Views Asked by At

In google analytics, I have created the following include filter:

^https:\/\/(my\..*|accounts\..*|maya\..*\/reports\/(mymessages|favorites)|maya\..*\/account\/notification|info\..*\/(heb|eng)\/management\/generalpages\/pages\/(personalfolder|registration|change_password|userssearchindex|security%20search)\.aspx).*

In order to include only URLs that contains the following addresses:
https://my.tase.co.il
https://accounts.tase.co.il
https://maya.tase.co.il/reports/mymessages
https://maya.tase.co.il/reports/favorites
https://maya.tase.co.il/account/notification
https://info.tase.co.ilManagement/GeneralPages/Pages/PersonalFolder.aspx
https://info.tase.co.ilManagement/GeneralPages/Pages/Registration.aspx
https://info.tase.co.ilManagement/GeneralPages/Pages/Change_Password.aspx
https://info.tase.co.ilManagement/GeneralPages/Pages/UsersSearchIndex.aspx
https://info.tase.co.ilManagement/GeneralPages/Pages/Security%20Search.aspx

But for some reason i cant get it to work. What am I doing wrong?

Thanks for your help!

1

There are 1 best solutions below

0
The fourth bird On

The pattern does not match the links that start with info. because the pattern specifies info\..*\/(heb|eng) and in the example data there is no heb or eng present.

You can either remove that part or use a pattern that exactlty matches starting with those urls:

https:\/\/(?:(?:accounts|my)\.tase\.co\.il|maya\.tase\.co\.il\/(?:reports\/(?:mymessages|favorites)|account\/notification)|info\.tase\.co\.il\/Management\/GeneralPages\/Pages\/(?:PersonalFolder|Registration|Change_Password|UsersSearchIndex|Security%20Search)\.aspx).*

See a Regex demo.