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 recommended login event. It tells you which method a user used to log in, for example credentials or google-oauth. Hence, it's not required (or applicable) to track GA4 events in general and it's not required (but recommended) for the login event.
| Name | Type | Required | Example value | Description |
|---|---|---|---|---|
| method | string | No | The method used to login. |
(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:
| Category | Action | Label |
|---|---|---|
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:
| Event Name | 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.