How to log button click redirect to website?

To log something you will need some space where you can save your logs right?

This for i would suggest you to generate a DATABASE.
Add a DB-Field → called how ever you want to this DB, for example → “logs”

Now you write the code for your “button1”, which will activate the function.

import wixLocation from 'wix-location';

$w.onReady(()=>{
	$w('#button1').onClick(()=>{
	let URL = "https://www.google.com";
		wixLocation.to(URL);
		saveLog(URL)
	});
});

function saveLog(URL) {
	toSave = {
		title: "whatever",
		logs: URL
	}
	
	wixData.save("yourCollectionIDhere", toSave)
    .then((results)=> {
        console.log(results.items); //see item below
    })
    .catch((err)=> {console.log(err);});
}