[deleted]•

[deleted]

11
iamcodemakerOP•

That's a good point. In this case though, there is already a crate named gtag. I suppose gtag-js could have worked as a name as well. I honestly didn't give it much thought.

5
iamcodemakerOP•

I've re-published the crate as gtag-js. I'm in the process of updating the article.

3
iamcodemakerOP•

TL;DR: I went on a journey to figure out how to use Google Analytics from Rust front-end Wasm code. On the way I learned how to call JavaScript code from Rust using Wasm-bindgen and made a crate to wrap Google’s gtag.js framework.

7
tafia97300•

Not super familiar with wasm but how do you tell where to load the gtag js script from?

2
iamcodemakerOP•

In this case it is expected to be already loaded in as a global JavaScript variable. Google's gtag.js docs have instructions on how to do that. This crate works with those instructions.

2
steadylearner_p•

Thanks for sharing this. It will help me a lot later.

1