Home >
Tracking Campaigns >
Other Systems (CPVLab, iMobiTrax, P202, Track Revenue, Click, Google Analytics, etc.)
Use Custom Channel Groupings in Google Analytics (1)
08-03-2017 06:57 PM
#1
rolandb ()
To create Custom Channel Groupings in Data Studio, you'll need to create a calculated field. This tutorial requires some very basic knowledge on how to use Data Studio.
Useful Links:
Calculated field function list
Conditional calculated fields
- In your GA data source, click the blue + icon to create a new calculated field.
- For anyone with coding experience, this should be a walk in the park. In this case, we'll want to use the CASE statement. Bust out notepad or your favourite text editor to enter in your formula. Google only has a single line, so for longer formulae, I recommend keeping a cleaner copy in text for easier future edits. For the same grouping as the tutorial above, the formula would be:
Code:
CASE
WHEN REGEXP_MATCH(Campaign, "(.*)(Newsletter)(.*)") AND Source = "ActiveCampaign" THEN "Newsletter"
WHEN Source = "ActiveCampaign" THEN "Other Email"
ELSE "Non-Email"
END
I laid out the spacing as above so it pastes nicely into the formula field. Basically the formula says: when the dimension Campaign contains Newsletter and the Source is exactly "ActiveCampaign", return "Newsletter", otherwise, when the Source is exactly "ActiveCampaign", then return "Other Email". For all other cases, return "Non-Email". As in the previous tutorial, the order in which each expression is laid out matters, which is why it looks like there is some overlap between the 2 conditions, but it works because of the ordering. If it were the other way around, the Newsletter category would never be returned. The links above shed more light on this. - Click Create Field. Now you have the a custom dimension! There is a lot you can do with this. If anyone needs help (for any calculated field, not just conditionals), feel free to PM me or reply here.
Home >
Tracking Campaigns >
Other Systems (CPVLab, iMobiTrax, P202, Track Revenue, Click, Google Analytics, etc.)