Capture Country Name using pre submission and geolocation service

I would like to capture the name of the country where the form was completed. I don’t want the visitor to complete it, I want it to happen automatically, like in a hidden field.

According to Gravity forms support;

“I can use the gform_pre_submission filter to send user’s IP address to some geolocation service and then populate a filed with the country name.”

Can someone help me link these pieces together, get it to work as described above?

Thank you.

How about using this plugin?

Requires this:

Chris,

Do you know what might have happened to the GeoIP Dectection plugin. I encountered the following message here: https://wordpress.org/plugins/geoip-detect/

“This plugin has been closed as of March 20, 2020 and is not available for download. This closure is temporary, pending a full review.”

I have not heard anything about that one. It’s a recent message and it looks like it’s being reviewed now. Could be a security issue or other violation of the terms. I would check back in a couple days, or seek an alternative.

Can you recommend an alternative?

I have not used any others, but this one turned up in a quick search:

https://gravitygeolocation.com/

1 Like