M
M
mariya_scherbakova2020-08-07 11:01:04
Google Analytics
mariya_scherbakova, 2020-08-07 11:01:04

Which gtag.js event tracking code is correct?

What is the correct code for tracking the goal-event in Google Analytics for gtag.js?

1. gtag('event', 'Custom event name', { 'event_category': 'bbb', 'event_action': 'aaa' });
or
2. gtag('event', 'aaa', {'event_category': 'bbb'});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Denisov, 2020-08-07
@DeoZ

Correct as it says in the manual:

gtag('event', <action>, {
  'event_category': <category>,
  'event_label': <label>,
  'value': <value>
});

Accordingly, the name of the action "action" is taken out of the list of parameters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question