Clicks Event Tracking (Google Analytics) - Search Bar\ Menus Buttons - Any way to track that?

Hi there WIXcode heros.
After talking to the support help-desk, I was unable to track clicks that takes place ‘inside’ Menus \ Search Bar \ Calendars.
As for a buttons - I open the “Properties”, add a On-Click lable, and then I used this code:
import wixWindow from ‘wix-window’;
export function downloadButton_click(event, $w) { wixWindow.trackEvent(“CustomEvent”, { “event”: “Document Download”, “eventCategory”: “Downloads”, “eventAction”: “Download”, “eventLabel”: $w(‘#dataset1’).getCurrentItem().title } ); }
And it works just fine! - My Google Analytics reads the Event!
But when entering a Menu ‘Properties’ ,for example, there is no ‘On-Click’, and further than that… there is no real separation between the different buttons there, to configure individually, each one as a different ‘Event’. I could replace the menu for buttons to by-pass this, but…
On a Wix-Hotel “Search Bar”, or - Calendar, its not really possible, since its connected to the data base (CRM), and therefor impossible to replace by buttons… (or is it?)

Thanks so much for your help!

any help please? thanks !

Hey! I tried your code but my click button failed to respond again. Did this happen to you?

Wix already had a tutorial about setting this up.

See the video here and look at the code reference page too.
How to Use Wix Code with Marketing Tools to Create Custom Events

Thank you!