Save URL in the form in my collection database

Helle, I would like to save the link users used to visit my page. in this example, some users are coming from “www.example. com/video-order-page?longAnswerField=case+name&shortAnswerField=name+witness”.
I want to save this link in the form database.

Right now, I have
import wixLocation from ‘wix-location’ ;
$w . onReady ( function () {
console . log ( wixLocation.query );
$w ( “#input5” ). value = wixLocation.query [ “shortAnswerField” ];
$w ( “#textBox1” ). value = wixLocation.query [ “longAnswerField” ];
});

What can i do to save the link?

Thanks

Hello peeps, anyone :slight_smile:

You are trying to get all the links → users are using on your website?

For example you have several BUTTONS, which guides your USERES somewhere.

Once clicked on one of the buttons —> !!! BOOM !!!

You saved the link ?
You saved the click-counter?
You saved the time?
You even maybe saved the user who clicked?

Is that what you want?

You already generated a DATABASE for all the DATA ?

Hi,
I have links that are unique that users are going to click from different places on my app. For example, www.example. com/video-order-page?longAnswerField=case+name&shortAnswerField=name+witness Will autofill “case+name” and “name+witness” in the form and when its submitted I need to also save the original link used “example, www.example. com/video-order-page?longAnswerField=case+name&shortAnswerField=name+witness” because i will need to re-share this link in future dates.

I just need to save the link. The database contains and already saves the default stuff that was created with the form, I haven’t created anything new as of yet.

You are looking for this

https://www.wix.com/velo/reference/wix-location/url

It will take the whole URL of the user on the page.
there is cleaner methods to do this but based on your above code I suggest you make another form field, and write code

$w('#inputFullURL').value = wixlocation.url;

if you don’t want people to see that line remember you can hide/collapse it from the form, its still considered a field that will be saved into your form database.