Jump to content
X2Community Forums

Recommended Posts

Whenever a webpage with a contact form gets loaded, a browser popup alerts the user that the site would like to track their location. We DO NOT want this feature enabled. However, it is unclear if it can be disabled for forms. We have disabled geolocation under the Web Tracker Setup area but this has had no effect. How can we disable geolocation on weblead forms? This was not previously an issue since we did not have SSL enabled on the website.

Link to post
Share on other sites

Hey Webservio,


Currently, this is an intended feature of the web lead forms, but in the future we may provide an option to disable location. For now to satisfy your customization, I would suggest in your current instance to edit the direct source code (after backing up) and to find $model->loglocation() in /protected/components/WebFormAction.php. From there you can delete the call to that function, which should stop the prompt of tracking their location. Hope that helps.

Link to post
Share on other sites

Hi Isaiah,


Thanks for the quick response. We took a look at that file and found an instance of loglocation. However, that file seems to only control functions upon submission of a form, but the location tracking is being triggered upon page load before a form is ever submitted. Commenting out or deleting the loglocation call did not seem to affect the location tracking since we still received the same browser notification. Is there some other file that manages the tracking for a page with an iframe before a form is even submitted? Possibly a function managed by WebListenerAction.php, webListener.php, or webTracker.php?

Link to post
Share on other sites

We've inspected the html code that is generated from the iframe and pinpointed the part that is triggering the geolocation:


<input type="hidden" name="geoCoords" id="geoCoords"></input>
        (function () {
            if ("geolocation" in navigator) {
                navigator.geolocation.getCurrentPosition(function(position) {
                var pos = {
                  lat: position.coords.latitude,
                  lon: position.coords.longitude

                $("#geoCoords").val(JSON.stringify (pos));
              }, function() {
                console.log("error fetching geolocation data");
        }) ();



It would appear that the form generator automatically inserts this hidden input and the associated script. How do we prevent this from happening when we create a form?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...