0

I'm filtering to count homepage pageviews, I want to include visits to both the homepage (/) and the homepage with additional URL parameters e.g. (/?source=facebook&campaign=2020ads), will the following pick this up?

Include > Page > Equal to (=) > /

Naturally I assume if I change Equal to, to Contains it will pick-up every page on the site, since they all include a '/'?

1

You are correct that changing equality to containment will make your filter pick up every page of the site. As equality, though, it will exclude pageviews with query parameters.

To me the easiest way to filter to "home page with or without parameters" is a short regular expression:

^/(\?.*)?$

That is:

^/ the path must begin with a slash,

(\?.*)? optionally include [? applied to the parentheses] a string starting with a question mark [escaped to be literal, \?] followed by anything [.*],

$ and then end.


As an aside, your example shows custom parameters recording the kind of information that UTM parameters are usually used for. Using UTMs would automatically put that data in the associated acquisition dimensions like Source and Campaign and clean it out of the page path.

1
  • That's awesome thank-you. Yes agree, bad example we do use UTM tags for these. This page in question had a lot of Hubspot/Facebook ad parameters firing all over it. I'm going to exclude them in Google Analytics but still need to count the old ones. Sep 9 '20 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.