Luka Cempre has once again shared something truly impressive. I'm a huge fan of his work, and I regularly incorporate his templates into my work projects. This time, he dropped a function code that mirrors the logic behind Custom Channels Grouping according to GA4 rules.
As you may know, the GA4 export in BigQuery doesn't automatically categorize traffic into the familiar channel groups like social or paid. For platforms dealing with high traffic, manually redefining the grouping for numerous resources can be quite a hassle.
But here's where Luka comes to the rescue. In this function, he's taken care of processing 820 platforms, distributing them among channel groups based on Google Analytics logic – all neatly outlined in a PDF file (yes, really!).
What's even better is that the function allows users to add their platforms to the groups they want and tweak the field value for channels that haven't been defined.
If you work with GA4 to BigQuery exports, be sure to check out my SQL cheat sheet.