Skip to main content

Capturing Conversion URL

Hi Guys,

I’m trying to capture the conversion URL of the form field.

I’ve got as far as:

  • creating a hidden text field

  • asking it to populate via the url

  • setting default answer both as {{page_url}} and / leaving blank

Nothing seems to get captured. It’s proving rather annoying. Im hoping someone has a solution. Many thanks.

3 comments

Log in to comment and vote

Comments3

  • Süleyman KILINÇ

    •

    Sep 17, 2025

    Hi there 👋

    Thanks for reaching out! I think this article from our help center might be useful for your case:
    https://forms.app/en/help-center/how-to-get-value-from-url-when-embedding-your-forms

    Here’s an example with sample data:

    <!-- Example Data -->
    <!-- 640766432fde613d93222a7e -> FormId -->
    <!-- 63ebad419442ad0448b9e9b6 -> QuestionId --> 

    If you embed your form like this:

    <div formsappId="640766432fde613d93222a7e"></div> 
    <script src="https://forms.app/static/embed.js" type="text/javascript"></script> 

    Then you can set a default value for the desired field:

    <script> 
    const pageLink = window.location.href; 
    var formsappForm = new formsapp( '640766432fde613d93222a7e', 'standard', { width: "100vw", height: "600px", answers: { "63ebad419442ad0448b9e9b6": pageLink } } ); </script> 

    Here’s a complete example that includes both the embed script and the default value script together:

    <div formsappId="640766432fde613d93222a7e"></div> 
    <script src="https://forms.app/static/embed.js" type="text/javascript"></script> <script> 
    const pageLink = window.location.href; 
    var formsappForm = new formsapp( '640766432fde613d93222a7e', 'standard', { width: "100vw", height: "600px", answers: { "63ebad419442ad0448b9e9b6": pageLink } } ); </script> 

    👉 You can easily find the QuestionId of your field in the form editor (see the article linked above for details).
    https://forms.app/en/help-center/how-to-get-value-from-url-when-embedding-your-forms

    Hope this helps.
    If you need further assistance, please don’t hesitate to ask.

    Süleyman

    • Honda

      •

      Sep 18, 2025

      This is perfect thank you. Im in the process of parsing this through Zapier. I typically use make.com which is a bit more intuitive. A good feature enhancement would be to be able to do this via the UI. Really appreciate your help, thank you ☺️

  • Honda

    •

    Sep 17, 2025

    Ok so below is my code. I'm basically trying to target the iframe by id and capture the current page URL. By default it pulls in the formApps URL which isn't what I want. Once that value is converted to a string I then want to override the default value of the field so that the page link is captured.
    Why this is not offered out of the box like other form apps I have no idea.
    
    <script>
    
    document.addEventListener('DOMContentLoaded', function() {
    
        // Get a reference to the iframe
        const myIframe = document.getElementById('formAppForm');
    
        // Access the iframe's document
        const iframeDocument = myIframe.contentDocument || myIframe.contentWindow.document;
    
        //target input field
        const pageLink = window.location.href.toString();
        const convUrl = iframeDocument.getElementById('i-text-35');
    
        // Check if the element exists before attempting to update its value
        if (convUrl) {
            // Update the value of the field
            convUrl.value = pageLink;
        }
    });
    
    
    </script>