cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to group similar referrers together?

Amr.Gamal
Producer

Hello, 

 

In my EUM Dashboard, I want to add a pie chart of referrers so it appears as in the attached image 

for example, there is more than one value of google referrers.

 

I want to group referrers so that all referrers that contains google.com are considered one group (google referrer) and all contains (Facebook.com) has value of Facebook and so on .

 

I don't need to show distribution based on each unique value

 

How can I do this?

 

note: the used query as below

SELECT referrer, count(referrer) FROM web_session_records WHERE referrer IS NOT NULL

 

Thanks Screen Shot 2021-03-09 at 3.30.11 PM.png

 

^ Edited by @Ryan.Paredez for readability.  

1 REPLY 1

Mario.Morelli
Architect

Hi Amr

 

You can use the substring & Index ADQLfunctions.

 

Something like 

SELECT substring(referrer, 9, indexOf(referrer, '/', 3)-9), count(*) FROM web_session_records WHERE referrer IS NOT NULL

 

Might need to adjust a little bit 

 

Ciao



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A