No results found. Try again with different words?

Search must be at least 3 characters.

    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 –

    Additional Javascript in Convert Pro
    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 –

    Hidden Field ID in Convert Pro


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

    Note:  After call-to-action Open and After call-to-action Close is not available for the following CTA’s.

    • Before/After
    • In-Content
    • Widget

    So in this case you can use any external plugin to add the above JS code, like a code snippet.

    Was this article helpful?

    Did not find a solution? We are here to help you succeed.

    Related Docs

    Compare Convert Pro with...

    29439
    29440
    Scroll to Top