9
votes

I have designed a Google web form. This form is sent to number of clients. All the fields that are submitted are recorded to Google spreadsheet. I need to capture the IP Addresses of clients and time-stamp to spreadsheet when client updates his information.

How can I make the client to include its own IP address to store it in spreadsheet?

4
You cannot capture the IP inside Forms. As an alternative, you may send your clients a pre-filled URL with a unique ID that will identify the client's entry in the response sheet.Amit Agarwal
Is there any other way to store IP of client to spreadsheet through php or any other scripting.Sanjay Goswami
Don't forget Google docs runs on Google's server. When a user submits a form the IP of the responder is not useful since since data goes from google to google... Why do you need this IP ? for localization ? identification ?Serge insas
For verification of client that he has submitted this form from this IP addressSanjay Goswami
you could do as Amit suggests then. Have some way of generating a prefilledUrl for the form from a separate front-end as you say perhaps php.JSDBroughton

4 Answers

1
votes

To make the clients to include their own IP address in a Google Form you should ask them to write the IP address themselves.

The alternative is to pre-populate the answers and send the custom URL to them. For identification purposes, if you don't know the IP address, instead use a unique ID.

References
Pre-populate form answers - Docs editor Help

1
votes

You can set up a reverse proxy that injects a javascript file in the form, that JS bit can detect and save the user IP in a field, along with any other info you’d need such as user agent, language, local time and so on. This isn’t exactly trivial but may be worth exploring.

I don't have any precise examples but what you can do is:

  1. set up apache with mod_proxy to act as reverse proxy in front of the website
  2. use mod_substitute to replace some JS on the page with a version you host
  3. add any fields you need to the form so that when it's sent you get the data in the parameters

https://httpd.apache.org/docs/2.4/mod/mod_substitute.html

-2
votes

Old topic I know but I found this thread as I am trying to similar.

I've had to resort to forgetting the Forms idea and reverting to Sheets.

You can then use Regex to validate =REGEXMATCH(C6,"\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}")

Data Validation for IP image

Not the ideal solution but a viable alternative for what I need....and me be of help to others