Capture URL or any parts of the HTTP request in the form submission through the web

What is the problem? Please be detailed.

Is there a way for the form to capture the URL of the website where the form is embedded, or any parts of the HTTP request? I have two possible scenarios:

  • same form on multiple websites, and we want to determine which site was used to fill the form?

  • the http request can contains referrer id, and we want to capture it in the form?

I'd love to help, but your post does not contain enough information for me to answer your question. In general, the best way to get help is to fill out the questions in the pre-filled template that you get when you create a support post. So, with that in mind, can you answer these questions?

  1. What ODK tool and version are you using? And on what device and operating system version?
  2. What steps can we take to reproduce the problem?
  3. What you have you tried to fix the problem?
  4. Anything else we should know or have? If you have a test form or screenshots or logs, please attach.

I thought my question was straightforward.

What ODK tool and version are you using? And on what device and operating system version?

ODKBuild 0.3.3 and excel to create a spreadsheet and upload to kobotoolbox dot org.

But I can switch to a different tool.

What steps can we take to reproduce the problem?

For example, submitting data to https://ee.kobotoolbox.org/x/#t7fC7hsv?referrer=13 and https://ee.kobotoolbox.org/x/#t7fC7hsv?referrer=42 yield the same metadata

What you have you tried to fix the problem?

I read the entire xform documentation (xlsform dot org).

I tried creating sample form with all the metadata fields that I saw in the xform documentation, and URL is not captured

Anything else we should know or have? If you have a test form or screenshots or logs, please attach.

n/a

Hi @marjeta! There are a lot of tools in the ODK ecosystem and so without the detail you've provided it was hard to understand the question. In this case, the issue is with Kobo, so your best bet is to ask the the Kobo team at http://help.kobotoolbox.org.

Kobo actually uses Enketo to perform its web-based form preview and submission. So if you are trying to capture this data specifically when submitting (ODK) forms via Enketo, your best bet might be to hop over to the enketo-users forum and see if anyone can help out. Although, several of the core Enketo folks - specifically @martijnr - lurk around here too, you may get a faster, more precise response there.

I wouldn't mind using a different tool, if it would help with capturing url

Just to be clear, as part of an enumerator submitting a form result, you also want to capture the URL of the original form that was used? Or something else?

I'm not sure what you mean by "original form".
I want to be able to distinguish between <base_url>?referrer=13 and <base_url>?referrer=42 --- it's the same form, but the URLs are different.

OK. I believe I understand now: when you deploy a form in Kobo, to be submitted via Enketo, you want to include a custom parameter in the Kobo's HTTP request (eg "referrer=123") that you'd like Enketo to pick up and include in the submitted form result's metadata.

I do not believe such a thing is possible in Enketo, and its certainly outside of the scope of ODK. Again, your best best would be to raise the request with Kobo and/or Enketo.