Learn business growth with Google Analytics 4 Forums Google Analytics 4 Sending an event to a specific tracker when using react-ga4 with multiple trackers Reply To: Sending an event to a specific tracker when using react-ga4 with multiple trackers

  • Daniel

    Member
    5 October 2022 at 6:34 pm

    You can send a specific event to one particular tracker by referencing the tracker name directly when you send the event. For your case, you can first give your trackers names when you create them. For example, ‘tracker1’ to the ‘G-0000001’ and ‘tracker2’ to the ‘G-0000002’. Then, in the command to send the event ‘timeToLoad’, reference it to ‘tracker1’ will send this event exclusively to the first tracker with the ID ‘G-0000001’. An example code might look like this: ga(‘tracker1.send’, ‘event’, { eventCategory: ‘category’, eventAction: ‘timeToLoad’}).