Expand my Community achievements bar.

SOLVED

Question: create segment for specific URL expressions?

Avatar

Level 8
Level 8

how to create segment in Analytics workspace, or Adhoc to filter the referred URL is:  https://www.domain.com/us/en/ ONLY? Country/Language code vary.

e.g. in the segment, contains:

https://www.domain.com/us/en/

https://www.domain.com/de/de/

https://www.domain.com/jp/ja/

 

But NOT contains any other referrers, e.g.

https://www.domain.com/us/en/compare/

https://www.domain.com/us/en/product/

https://www.domain.com/us/en/qa/3341234/

 

Thank you.

H

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
8 Replies

Avatar

Correct answer by
Community Advisor

Would this work?

Screenshot 2020-09-16 at 9.13.25 AM.png

Avatar

Level 8
@H_L - If the referring URL includes parameters or hash values beyond the pathname, would you want to include those in your segment (assuming all other criteria is met)?

Avatar

Level 8
Level 8
No. Sorry forgot to mention, we give user's choice, they can choose any of the language/country combination, which means there are almost unlimited /us/en/, /de/en/, etc...

Avatar

Level 8
Level 8
@Brian_Johnson_ - emm, sorry I didn't get the point. what's the mean of "beyond the pathname"?

Avatar

Level 8
@H_L - I was referring to things like the query string (?) or hash (#). If you're filtering for a referring URL, and you want to exclude those from your criteria, you can't use "ends with" criteria. You'd have to use an option that specifies "contains" or "matches" instead. Though, you'll probably need to specify various values, for example: "/us/en/" OR "/us/en/?" OR "/us/en/#" OR "/us/en?" OR "/us/en#". Another option would be to update your data collection (implementation) to capture what you're looking for so creating a segment is much easier. For example, pull the {{loction}}/{{language}} value from the referrer and capture it in a prop as part of any necessary calls. Then your segment would just be "propN equal '/us/en'" and you're done.

Avatar

Level 8
Level 8

@Brian_Johnson_, thank you for the further explanation. What we want, is to identify the traffic referred from respective country/language home page.

That's why we only want to filter out referrer from https://www.domain.com/us/en/,  but don't want to include https://www.domain.com/us/en/compare/

And, there will "unlimited" combination of country/language, as said before, we give user freedom to access any of the combination, e.g. /us/ja/, /br/ko/, /jp/br/, so it's nearly not possible to input all the values one by one.

The way you mentioned to implement, sorry I am not sure can make it or not.

 

But we used another way, exported all the referrer, counts the length, and filter. As all the https://www.domain.com/us/en/ contains same count of charaters and starts with same domain

 

Thanks again for your inputs.

Avatar

Level 8
Level 8
Hi @yuhuisg, thanks for reply, but it would not work, because there will be unlimited varies of /country/language combinations, e.g. /us/ja/, br/pt, br/zh, etc...

Avatar

Level 10
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?