Created
May 14, 2024 20:53
-
-
Save taylorgorman/3190c3e5948d655d0a23b70b2785ea99 to your computer and use it in GitHub Desktop.
Google Looker Studio field formula to group Session Sources typically split up by subdomain. Pairs well with Session Channel Group.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF( CONTAINS_TEXT( Session source, "facebook" ), "Facebook", | |
IF( CONTAINS_TEXT( Session source, "fb" ), "Facebook", | |
IF( CONTAINS_TEXT( Session source, "ig" ), "Instagram", | |
IF( CONTAINS_TEXT( Session source, "instagram" ), "Instagram", | |
IF( CONTAINS_TEXT( Session source, "Instagram" ), "Instagram", | |
IF( CONTAINS_TEXT( Session source, "linkedin" ), "LinkedIn", | |
IF( CONTAINS_TEXT( Session source, "lnkd.in" ), "LinkedIn", | |
IF( CONTAINS_TEXT( Session source, "t.co" ), "Twitter", | |
IF( CONTAINS_TEXT( Session source, "pinterest" ), "Pinterest", | |
IF( CONTAINS_TEXT( Session source, "reddit" ), "Reddit", | |
IF( CONTAINS_TEXT( Session source, "linktree" ), "Linktree", | |
Session source | |
))))))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needs more conditions, I'm sure. Feel free to suggest!
To add to a data source from a report: Resource → Manage added data sources → Edit → Add a Field → Add calculated field → Field Name = Session source group; Formula = paste the above pile of IF statements. → Save.