We want to track which of our pages generates form completion by our visitors. Is there a way to capture and record the URL that a form was submitted from?

Yes, there is.

First, create a hidden field in your form with the following properties:

Type: hidden input

Label: Referring URL (or whatever you want to call it)

Name: page

Click on SAVE PROPERTIES to save the element data, and then click on the SAVE icon in the upper right-hand corner of the screen to save the form with the new element.

Then, within your form's properties, go to Advanced > More Options. Then click on the FORM PIECES tab at the top of the popup screen.

In the first section (BEFORE FORM), click on the CUSTOM button. In the field that opens up underneath that, enter this code:

$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80")
{
     $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}
else
{
     $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
$this->execPieceByName('ff_InitLib');
ff_setValue('page', $pageURL); // 'page' is the name of the hidden field

 

Then click on the SAVE icon in the lower right-hand corner of the screen to save the piece that you just added.

When back on the form properties page, click on the SAVE icon in the upper left-hand corner of the screen to save the form itself.

 

Note: the URL shown above does not match the real URL of this site because the form is shown in an IFrame. Without IFrames you will see the correct URL.

 

 

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!