Where Are My Custom Marketing Channels in Data Studio?

Estimated Reading Time: 3 minutes
May 26, 2022
Where Are My Custom Marketing Channels in Data Studio?

Google’s free Data Studio tool is amazing for visualizing and reporting on your data. It also plays very well with other Google tools, like Google Ads and Google Analytics. However, it does have some limitations. One of those limitations is that it cannot pull in your custom channel groupings from Google Analytics.

Fortunately, all is not lost as you can use Data Studio’s calculated fields feature to build your own custom channel mappings in Data Studio. Inside your Google Analytics source, set up a calculated field. Then, input the code below:

CASE 
WHEN ((Source=”direct” AND Medium=”(not set)”) OR Medium=”(none)”) THEN “Direct” 
WHEN Medium=”organic” THEN “Organic Search” 
WHEN (Social Source Referral=”Yes” OR REGEXP_MATCH(Medium,”^(social|social-network|social-media|sm|social network|social media)$”)) THEN “Social” 
WHEN Medium=”email” THEN “Email” 
WHEN Medium=”affiliate” THEN “Affiliates” 
WHEN Medium=”referral” THEN “Referral” 
WHEN (REGEXP_MATCH(Medium,”^(cpc|ppc|paidsearch)$”) AND Ad Distribution Network!=”Content”) THEN “Paid Search” 
WHEN REGEXP_MATCH(Medium,” ^(cpv|cpa|cpp|content-text)$”) THEN “Other Advertising” 
WHEN (REGEXP_MATCH(Medium,”^(display|cpm|banner)$”) OR Ad Distribution Network=”Content”) THEN “Display” ELSE “(Other)” 
END

This will build your custom channel map for most standard data sources and mediums.

To add a custom channel, insert another WHEN clause like in this example below:

WHEN Source=”mysource” THEN “mysource”
WHEN Medium=”mymedium” THEN “mymedium”

You can also modify the channel mappings listed above; for example, maybe you call your email “Direct Mail” or you have a source of “Affiliate” instead of a medium.

Note that WHEN clauses are executed in order. Therefore, a session will map to the first WHEN clause seen.

A good way to implement a custom channel map in Google Data Studio is to look at your current custom data map and then copy the values over to this code.

For example, in the screenshot below I created a custom channel for traffic coming from my main domain to another site:

To build this in Data Studio, I would use the following code:

WHEN Source=”maindomain” THEN “Main Domain”

Which looks like this using the full code from above:

CASE 
WHEN ((Source=”direct” AND Medium=”(not set)”) OR Medium=”(none)”) THEN “Direct” 
WHEN Medium=”organic” THEN “Organic Search” 
WHEN (Social Source Referral=”Yes” OR REGEXP_MATCH(Medium,”^(social|social-network|social-media|sm|social network|social media)$”)) THEN “Social” 
WHEN Medium=”email” THEN “Email” 
WHEN Medium=”affiliate” THEN “Affiliates” 
WHEN Medium=”referral” THEN “Referral” 
WHEN (REGEXP_MATCH(Medium,”^(cpc|ppc|paidsearch)$”) AND Ad Distribution Network!=”Content”) THEN “Paid Search” 
WHEN REGEXP_MATCH(Medium,” ^(cpv|cpa|cpp|content-text)$”) THEN “Other Advertising” 
WHEN (REGEXP_MATCH(Medium,”^(display|cpm|banner)$”) OR Ad Distribution Network=”Content”) THEN “Display” 
WHEN Source=”maindomain” THEN “Main Domain”
ELSE “(Other)” 
END

And it looks like this in Data Studio. First, the code:

Second, the data:

With this knowledge, you can easily create custom channel mappings to better display your or your client’s channels as you want to see them.

Have additional questions about Data Studio?

Our team of experts is here to help!

Author

  • Ben Brooks is a Senior Lead Digital Analytics consultant at InfoTrust. In this role, he works with clients to understand their analytics needs and concerns. He then works with developers to implement analytics to support these needs, and end users to understand and visualize the results of said analytics. In his free time, he can be found taking photographs of landscapes and transportation subjects, producing short videos, reading, and walking his miniature dachshund Bella. Ben lives in the Seattle, Washington area.

    View all posts
Last Updated: May 26, 2022

Get Your Assessment

Thank you! We will be in touch with your results soon.
{{ field.placeholder }}
{{ option.name }}

Talk To Us

Talk To Us

Receive Book Updates

Fill out this form to receive email announcements about Crawl, Walk, Run: Advancing Analytics Maturity with Google Marketing Platform. This includes pre-sale dates, official publishing dates, and more.

Search InfoTrust

Leave Us A Review

Leave a review and let us know how we’re doing. Only actual clients, please.

  • This field is for validation purposes and should be left unchanged.