I'm reading the google analytics documentation and I'm slightly confused about what method means. In their documentation they have
gtag('event', 'login', {'method': 'Google'});
https://developers.google.com/analytics/devguides/collection/gtagjs/sending-data
When you go to the measure Analytics page, method isn't listed in. They list the following params for event
gtag('event', <action>, {
'event_category': <category>,
'event_label': <label>,
'value': <value>
});
https://developers.google.com/analytics/devguides/collection/gtagjs/events
which doesn't list method. Does anyone know what this param does? And is it required to track events?
The
method
parameter is specific to the recommendedlogin
event. It tells you which method a user used to log in, for examplecredentials
orgoogle-oauth
. Hence, it's not required (or applicable) to track GA4 events in general and it's not required (but recommended) for thelogin
event.(https://developers.google.com/tag-platform/gtagjs/reference/events#login)
In GA-UA you could control the values for Category, Action, Label (the row data) (plus custom dimensions).
Example:
Interaction
Login
Google
In GA4, you can basically control the row data and the column names. (Gray fields can be set to any value).
Example:
method
failed_attempts
...
login
Interaction
2
...
method
is one of Google's recommended parameters, but you could also leave it out, give it a different name or add other parameters that you deem useful.