Analytics
3.6K members online now
3.6K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
 
Guide Me
star_border
Reply

How to combine many URLs for the same page in GA?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Dear all,

I've been having a problem with my GA report,

I want to merge 2 URLs that belong to the same page.

In my GA reports the data is shown as follows:

Ex: 

Article 1 (both links go to the same page)
/blog/post/12345678-this-is-my-blog
/blog/post/12345678
 
Article 2 (both links go to the same page)
/blog/post/45678901-grow-up-your-business
/blog/post/45678901
 
Does anybody know a solution for this problem? Any filter to merge them into one?
Thank you very much!
 
1 Expert replyverified_user

How to combine many URLs for the same page in GA?

Rising Star
# 2
Rising Star

Hey Luis, 

 

This is a structural issue that should be fixed ultimately with a 301 redirect or simply by preventing duplicate URLS. 

 

That being said, you can merge the 2 URLs by using the Find & Replace function: https://support.google.com/analytics/answer/1034834?

 

Let me know if this solves your problem!  

Joshua, Rising Star
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

Re: How to combine many URLs for the same page in GA?

Explorer ✭ ✭ ☆
# 3
Explorer ✭ ✭ ☆

Ultimately, Joshua is right, this should be fixed through a 301 redirect.

 

In the meantime, Joshua is also right about using a filter.

However, I don't think a simple Search & Replace will work in this case, you need to use an Advanced filter.

 

Field A: Request URI with (/blog/post/d+)-[^?#]+
Field B: empty
Output To: Request URI with $1

 

Essentially, it will strip out the "-this-is-my-blog" par of the request, while making sure to retain any querystring and hash if present.


Examples: 

  • /blog/post/12345678-this-is-my-blog > /blog/post/12345678
  • /blog/post/12345678-this-is-my-blog#something > /blog/post/12345678#something
  • /blog/post/12345678-this-is-my-blog?param=1 > /blog/post/12345678?param=1
  • /blog/post/12345678-this-is-my-blog?param=1#something > /blog/post/12345678?param=1#something
  • /blog/post/12345678 > not filtered
  • /blog/post/12345678abc > not filtered
  • /blog/post/abc/12345678 > not filtered
  • etc...

As always, you should have a "raw data view", a "test view" and a "production view". Create the filter in your test view and see how it goes before applying it in production... 

How to combine many URLs for the same page in GA?

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi Stéphane H, Thank you for your reply, but Im getting the same results in GA.

the URL "/blog/post/12345678-this-is-my-blog" is the result when people come to my article from google(organic).

and the "/blog/post/12345678" is when the visitors click to the article from my website (direct).

is there a configuration where I can extract the title of the article from the URL, and just keep "/blog/post/12345678" when someone click from google?

Thank you very much

 

Marked as Best Answer.
Solution
Accepted by topic author Luis P
June

How to combine many URLs for the same page in GA?

Explorer ✭ ✭ ☆
# 5
Explorer ✭ ✭ ☆

The page title is already automatically tracked. When you go under Behavior/Site Content/All Pages, where it says "Primary Dimension", you can click on Page Title and voilà! Actually, this is a very simple way to group both page paths into a single row in your report.

How to combine many URLs for the same page in GA?

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Awesome! I can see it now.

Thank you for your help.