react-ga4 icon indicating copy to clipboard operation
react-ga4 copied to clipboard

Missing events when send event to multiple trackers

Open dacsy opened this issue 2 years ago • 1 comments

Hi everyone I have a config multiple trackers, however when I try to send event to each tracker, it's missing events in the second tracker.

      ReactGA.initialize(tracker.trackingId);
      this.trackers.push({
        trackingId: tracker.trackingId,
      });
trackers.forEach((tracker) => {
    ReactGA.event(`Checkout started`, params); // Custom event
    ReactGA.event(`view_item`, params); // GA4 event
    ....
});

My first tracker work as expected. The second tracker are missing most of events. What am I missing in the configuration ?

dacsy avatar Jul 11 '23 10:07 dacsy

See this multiple products test as an example on how to initialize multiple products (i.e. trackers). There is also this example in the readme.

JeremyGuinn avatar Jul 12 '23 18:07 JeremyGuinn