How to Pass Current Page URL as a Value to Hidden Field of the Form?

Sometimes, we were asked whether website owners could track the page through which a user has filled a form successfully. This is possible with Convert Pro!

To pass current page URL through the hidden form field, you just need to add the following code to after call-to-action open section under Additional JavaScript.

Note: Please make sure you have installed and activated the Additional Script addon.

Convert Pro Editor -> Design -> Panel -> Additional JavaScript. Refer to this Screenshot –

var current_page_url = window.location.href;
var hidden_field_id = 'cp_hidden_input-2-249';

jQuery( "#" + hidden_field_id + " .cp-target").val( current_page_url );

You just need to modify the hidden field ID according to your hidden form field ID. You can find the ID for your hidden field here –

This way, your hidden field will pass the current page URL as a value.

Not the solution you are looking for? Check other articles, or open a support ticket.