-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update vue-gtag.d.ts #585
base: master
Are you sure you want to change the base?
Update vue-gtag.d.ts #585
Conversation
Adds currency to EcommerceAction
Note the typing is also used for the "refund" event, which is OK as Google Analytics also accepts, and even requests, a currency - see "* If you set value then currency is required for revenue metrics to be computed accurately.". This is also true for the Purchase event - see https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference/events#purchase @MatteoGabriele we may need to include a bit more advanced/dynamic typings to enforce this and/or do it on the code level. |
Add union types to make currency required if value is provided, as per Google docs on the matter.
@MatteoGabriele I have updated the types to make currency required if value is present, as per the Google docs. You can play with it here: |
I've added a final touch-up to enforce that the currency is exactly 3 letters and uppercase |
@MatteoGabriele can we get a move on this? This is actually quite important because this param is required according to Google. |
Adds currency to EcommerceAction see #566 (comment)
No further changes required.
^ looks like it will pass the currency as needed, and from there Google will know what to do with it.