1
votes

I'm quite new to regex and trying to do some Google Analytics filtering.

I have a website: www.domain.com (international version) and I have many country versions in subdirectories. e.g. www.domain.com/se

Now I want to create a filter to only show the international site. Therefore I have 15 (15 countries) exclude filters, which works ok, except for my "services" pages. The Swedish exclude, also filters out www.domain.com/services.

How can I exclude "/se" and "/se/" and "/se/*" without loosing my /services pages?

1
What does you current regex look like? For any of the countries. - OGHaza

1 Answers

1
votes

I'm not sure what google-analytics filters look like but if for france your filter looks like:

yoururl/fr

For sweden you could probably use:

yoururl/se(/|$)

Which says match /se followed by either a forward slash or end of input (/|$). You should probably add that to the end of all your filters to avoid excluding any other pages unintentionally e.g. yoururl/friendslist for the french example above.

See it on RegExr