Skip to content
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

Adjust encoding of event payload to work in Google Analytics #23

Open
quadmachine opened this issue Jul 7, 2023 · 0 comments · May be fixed by #24
Open

Adjust encoding of event payload to work in Google Analytics #23

quadmachine opened this issue Jul 7, 2023 · 0 comments · May be fixed by #24

Comments

@quadmachine
Copy link

Several attributes included in our tracking payload, e.g. page title include spaces which need to be encoded before being sent to GA. Currently this is done by

const qs = new URLSearchParams(JSON.parse(JSON.stringify(payload))).toString()

which returns a string where spaces have been replaced with +. Unfortunately GA doesn't decode this before displaying in it's UI, but it does hovewer decode %20 properly.

Is there any way that you switch to using encodeURIComponent to encode the payload in a way which will be decodeable by GA, or alternativelly even enabling a way to provide custom serialization function?

I can create a PR which fixes the encoding issue if that would work for you?

Cheers

@NimaC NimaC linked a pull request Jul 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant