How to set multiple tracker with different tracker name
I want to set multiple tracker for different page. In react-ga package there is a option in gaOptions named name and for specific pageview event I called that tracker name. And then the metrics go to the corresponding analytic. How to achieve this situation for your package?
I'm in the early stages of replacing react-ga with react-ga4 and need to accomplish the same thing. I was just reading about routing https://developers.google.com/tag-platform/gtagjs/routing. I'm wondering if we need to specify the name in the groups field instead of name, and then reference it in a send_to field when triggering any event, pageview, etc?
ReactGA.event('page_view', { page_location: '/home', page_title: 'Home', send_to: 'G-XXX' });
You can specify which tracker to use by setting the send_to option.
I'm trying to do the same thing but the send_to attribute never seems to be added to the api call sent to google. I'm trying to use an ad tracker and the syntax I'm using is:
ReactGA.event({ action: "conversion", category: "Conversion", label: "RCQ-XXXXXXXXXXXXXXXX", send_to: "AW-XXXXXXXXX/RCQ-XXXXXXXXXXXXXXXX", });
The event is received but the send_to attribute isn't included. This is what is received by google tag assistant :
API Call gtag("event", "Conversion", { event_category: "Conversion", event_label: "RCQ-XXXXXXXXXXXXXXXX", value: undefined, non_interaction: undefined })
The ID in the send_to AW-XXXXXXXXX has been added to the init array and is recognized so that works.
I have tried different permutations of the send_to attribute including send_to, sendTo. Sending as an array didn't make a difference.
I'm baffled.
Thanks in advance for any help!
Hey @asif-jalil did you find a solution for this ?