Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use "default channel grouping" as a dimension in Google Analytics API

I would like to use the Google Analytics API to get the data displayed on the Acquisition Overview webpage. Especially, I need to get the sessions (formerly called visits) break by Default channel grouping : Direct, Organic Search, Referral, Social, Paid Search, Email, Display and (Other).

As explained here, these groups are based on regex. Therefore, it might be possible to recode these rules, but I would prefer to use these groups as a dimension.

I googled it and most of the answers are referring to Multi-Channel Funnels (MCF), but according to the MCF dimensions & metrics reference, it's more about conversion.

Does anyone know how to use the Google Analytics API (or GA MCF API) to get such data ?

Thanks a lot !

like image 929
Romain André-Lovichi Avatar asked Oct 20 '22 09:10

Romain André-Lovichi


2 Answers

Acutaly I think you should be looking at the Core Reporting Api and dimensions and metrics

The thing that's going to be a little tricky is that first column. That column is Traffic Type and not something you can export directly. It is calculated based upon Source / medium.

Direct = Source not equal (direct) and Medium not equal to organic referral and cpc

Campaign = Source not equal to (direct) and Medium not equal to organic referral and cpc

organic = Medium is equal to organic

paid = medium is equal to cpc

I cant remember what social was I will have to look into that.

like image 128
DaImTo Avatar answered Oct 28 '22 15:10

DaImTo


Here is the link where you can find the GA definitions for Default Channel Groupings: https://support.google.com/analytics/answer/3297892?hl=en&ref_topic=3125765

When you go to this link, just click on the edit icon for the channel whose definition you want to see.

For example, for Social, the definition is:

Social Source Referral exactly matches Yes OR Medium matches regex ^(social|social-network|social-media|sm|social network|social media)$

Hope this helps.

like image 44
ttemple Avatar answered Oct 28 '22 16:10

ttemple