Help with Facebook Pixel and Button

Hello guys I need your help. I want to track the event as a Purchase, if someone clicks the button.
The Pixel code is:

but how do I combine it with the button?

I activated the developer tools in the editor and when I click on the Button I get the properties and I can add a onClick function:

export function button1_click(event, $w) {
}

How can I combine this?

no one has an idea?

Hi,
Could you explain further about this “purchase” ? what is the use case?

This might be what you are looking for.

https://www.wix.com/corvid/forum/wix-tips-and-updates/send-events-to-3rd-party-analytics-apps