Unable to set event-scoped custom dimension that applies to all sessions and events
Opened this issue · 5 comments
There is a similar issue reported here. However, the suggested solution only addresses user-scoped custom dimensions.
Also, the documentation for ReactGA.event(options)
suggests that dimension
and metric
can be passed in but this is not correct as the expected parameter is of type UaEventOptions
.
export type UaEventOptions = {
action: string;
category: string;
label?: string;
value?: number;
nonInteraction?: boolean;
transport?: ('beacon' | 'xhr' | 'image');
};
We're also running into this issue. The current types do not allow dimensions and metrics to be passed into .event
.
The types over here do support those parameters. Can they be included in this package's types?
https://github.com/react-ga/react-ga/blob/master/types/index.d.ts#L40
Yes same here, will there be a solution to support the parameters? @codler
This package is currently the only one for GA4 and according to npm it has over 50k weekly downloads :)
any one here know if it is possible to use this package to send user properties?
Having the same issue, if anyone finds an alternative that would be great
I'm running into the same issue with custom dimensions.
It appears to send the dimension if they are named 'dimension1', 'dimension2', etc.
I suppose this would make sense for migrating from reactGA as this was the required naming convention in UA.
For the moment, I am by passing the dimensions right to the gtag instance.
ReactGA.gtag('event', eventCategory, {...customDimensions });
where customDimensions
is something like {myDimension: 'some val', myOtherDimension: 'some other val'}