Hello everyone,
I am wondering if anyone knows if it's possible to code javascript into marketo form so that it can either
1) Automatically detect the visitor's country based on their IP address?
2) Allow visitor to select country code from the field (dropdown)
I am not a programmer and have almost no knowledge in coding. If anyone knows how, that will be a great help!
Thank you in advance.
-Peter
An external JS can detect Country based on the IP address (Geo-IP), this value can be used to auto-populate Country in the form (not a fan of auto-populating country based on the browser inferred values as you may risk capturing the wrong country value in-case a person is using a VPN to impersonate being in a different geographical region/country or confuse where the lead is today with where they actually live/work.)
Marketo's munchkin also detects the Inferred Country value based on the Geo-IP, the Inferred Country is set for the known person and is also detected for the anonymous visitors which can be viewed in the webpage activity report. Alternatively you can also use Marketo's RTP JS to get the visitor's location data.
There are 3 different ways to augment the Inferred Country field:
You can interweave all of these using JS, i.e. try to get them to opt in to #3 and then fallback to #1. There’s some working Geolocation code in this old demo.