Re: Google Analytics filter to remove .html from landing page urls

Dan_Smith1
Level 1

Google Analytics filter to remove .html from landing page urls

This article is pretty useless and already confirms what we already know. However, I am looking for an actual solution in our google analytics to search/replace landing page urls that end with .html to without for consistency. Some people remember to remove the .html and others do not. As a result we are getting duplicate line items one ending in .html and one without, which skews the data. 

Issue Description
Is it possible to remove the .html from landing page URLs?

 

Issue Resolution
Yes, the URLs will work without the ".html" suffix.

^ Not sure how that is a resolution, but I am looking to see if others have a real Google Analytics resolution for this issue. 

Thanks

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Google Analytics filter to remove .html from landing page urls

Search

  \.html(\?|$)

Replace

  \1

Test thoroughly (use the "verify" feature).

Note GA regexen are not properly anchored to URL components (host, path, query) and I find they cannot perform most tasks without some risk of false positives.

Dan_Smith1
Level 1

Re: Google Analytics filter to remove .html from landing page urls

Wow, Sanford you are a lifesaver! this worked! 

SanfordWhiteman
Level 10 - Community Moderator

Re: Google Analytics filter to remove .html from landing page urls

Awesome! Maybe worth a short blog post. Mark it as Correct?