I’ve got a few Hugo sites up and running, and they seem to be doing great! However, I’d like to quantify how they’re performing using an analytics platform such as Amplitude. I’m primarily a mobile dev, so please forgive the noob questions. Amplitude has a new Typescript SDK that I can import with npm. This seems like a great option, but I’m not sure how to do this with Hugo. They also have a javascript SDK, which may be the way to go.
My questions are:
- Which SDK (Typescript via npm or JS) would work best with Hugo?
- If Typescript via npm, how do I actually import and use it? I found info on the hugo docs about
hugo mod npm pack
but haven’t found any examples. I know it’s asking a lot, but a tiny sample where the hugo site sends an Amplitude event on a button press would be super helpful. - If JS, is there an easy way to capture the
onclick
for button presses and route it to the a JS function? Is there any Hugo magic that I could utilize in this situation?
Thanks a ton in advance. This is a bit over my head but I’d love to learn how to put all this together.