Sending Tracking events code snippet breaks the URL function

I’ve added a code snippet for sending & tracking events according to the following tutorial: https://support.wix.com/en/article/wix-code-tutorial-sending-tracking-and-analytics-events
The tracking seems to work fine for the button element I added it to. I see events on Google Analytics.
However, when clicking on the button on the live site, the url link does not forward me to the indicated url. I remain on the same page. Other links do work correctly.
So basically the button now triggers events but does not work as a link anymore.

Any ideas?
Thanks!

Maybe you have your link setup on the button using the link property and not using code? You can’t have two click events on one button. In code use wixLocation.to(url); and make that redirect after tracking the event is done.

Thank you Andreas! This indeed made it work! Thanks!

@markhahnfeld glad it worked. Please mark my answer as top comment, it helps me.