What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.

  • Profile Image

    Weebly Embedded Form: Can we capture Affiliate ID from URL parameter?

    Asked by SkyClaim on March 05, 2017 at 07:11 PM


    so is there any affiliate software that I could use and intergrate into jotform so that whoever sends the client will get a commission?

  • Profile Image
    JotForm Support

    Answered by Mike on March 05, 2017 at 07:16 PM

    If the idea is to get an Affiliate ID from URL parameter and pass it to the form, it might be possible since Weebly allows you to inject custom Javascript.

    I will try to come up with some example and update this thread tomorrow.

  • Profile Image
    JotForm Support

    Answered by Mike on March 06, 2017 at 09:37 AM

    This is how you can capture an affiliate ID from URL parameter and submit it with the form data.

    1) Add a SID field (you can change the name) which will hold the affiliate ID.

    2) Embed default form embed code and custom script to your Weebly page using Embed Code element at Weebly.

    Code example which includes default embed script and custom script:


    (on that code the form ID is 70636685646973 and field input ID is input_7, you will need to replace those values to reflect the correct form ID and input ID related to your form)

    3) Usage example:




    It will hold the value in user's browser local storage and submit it with the form data.

  • Profile Image

    Answered by SkyClaim on March 06, 2017 at 02:51 PM

    Mike- thanks so much for that.


    I'm not so tech savvy so a bit confused.

    Any chance you can explain it in simple terms / details for me?

    How would an affiliate register with me and would I have to give them a special link?

  • Profile Image
    JotForm Support

    Answered by Welvin on March 06, 2017 at 04:45 PM

    I'm sorry, but I think the steps are already simplified by my colleague. Maybe, we can just build the overall codes for you. I'm doing it now. I'll let you know.

  • Profile Image
    JotForm Support

    Answered by Welvin on March 06, 2017 at 04:49 PM

    Here's the codes: https://www.pastiebin.com/58bdd889674bf. Copy/paste this to your Weebly page. You have to use the "Embed Code" block as per my colleague's screenshot.

    As for the link, based on the usage, you would need to provide the affiliate link with a parameter for the ID. Ex:





    Let us know if you are still confuse about it.

  • Profile Image

    Answered by SkyClaim on March 21, 2017 at 08:24 AM

    thanks. but would this work if someone went from one page to another and then back - 


    ie. www.skyclaim.net?SID=12345

    then they click on FAQ and then go back to skyclaim.net

    will i then loose their details?

  • Profile Image
    JotForm Support

    Answered by david on March 21, 2017 at 11:33 AM

    As long as they use the same link with the SID parameter to return, the SID would still be populated via the URL parameter.  If they press the back button the browser it will return to the same page.  

  • Profile Image

    Answered by SkyClaim on March 22, 2017 at 07:03 AM

    thanks. so if they selected another option on the website and then by themselves went to claim form, i can't track it?


    Is there a way to keep the SID for all the pages of the website?

  • Profile Image
    JotForm Support

    Answered by Welvin on March 22, 2017 at 08:43 AM

    Actually, the SID will be kept in the field for as long as the user landed first on the affiliate URL, ex: http://welvinjotform.weebly.com/?sid=12345. Access this link. Go to the contact us page. Go back to the main page, you'll see the SID is kept. 

  • Profile Image

    Answered by SkyClaim on March 23, 2017 at 06:54 AM

    thanks for that but it didnt work for me.

    i used this:



    then went to 


    then went back to 



    but it didn't capture the AGENT ID?



  • Profile Image
    JotForm Support

    Answered by Welvin on March 23, 2017 at 08:55 AM

    Your scripts are correct. However, you have the incorrect field name for the parameters. It should be "agent45" instead of just "agent".


    Please correct that.

    Now, to see the updated output, you need to delete the current stored data from your browser. Otherwise, you'll see it as "Undefined".



    You need to find your website cookie and remove it.

    Let us know if you need further assistance.

  • Profile Image

    Answered by SkyClaim on March 24, 2017 at 08:41 AM

    thanks for the reply.

    i did what you said but its not working.

    the field name is 'agent' but whether I go directly from the link to claim form or if I go from page to page and back to claim page, it doesnt work......




    any ideas?

  • Profile Image
    JotForm Support

    Answered by david on March 24, 2017 at 11:12 AM

    The user needs to visit the page directly from the http://www.skyclaim.net/-claim-now.html/?agent45=11111 URL.  If they visit the page from another URL, the agent field will not be populated. 

  • Profile Image

    Answered by SkyClaim on March 26, 2017 at 04:44 AM

    hi there, the above doesnt make sense.


    if you read the thread, I was told that someone can provide a link such as http://www.skyclaim.net/-claim-now.html/?agent45=11111 and then the person can navigate the site and go back to the claim form and the number in the origonal url, this example is 11111 will be placed in the hidden agent field on the form.

    it's just not working so need some help here.....why was i told to do agent45 if the field name is agent?

    could you please help me and maybe get me the correct code to paste into weebly 'embed code' - maybe i have that wrong?

    thanks so much

  • Profile Image
    JotForm Support

    Answered by Welvin on March 26, 2017 at 07:08 AM

    I think my colleague meant to say that if the page will be accessed from a different page rather than the original landing link with prepopulated value.

    The agent45 is correct and should work after. However, you seem to have change the form again. So, what's the final field now? Is it the visible "Agent" field after the "Number" field? If yes, you should change your script to the following:



        if (localStorage.getItem("Agent") == undefined || localStorage.getItem("Agent") == null) {

            var Agent = location.search.split('Agent=')[1];

            localStorage.setItem("Agent", Agent);


        window.onload = function() {

            window.frames['63493430400447'].document.getElementById('input_27').value = localStorage.getItem("Agent");



    <script type="text/javascript" src="https://form.jotform.me/jsform/63493430400447"></script>


    input_27 (input ID) and Agent (Field Label).

    The URL will be then: http://www.skyclaim.net/-claim-now.html/?agent=11111

    Before you will test the page, make sure to clear the cookies for your website. This is very important. Otherwise, you'll see the old data in the form and the prepopulation won't work. 

  • Profile Image

    Answered by SkyClaim on March 26, 2017 at 09:07 AM

    thanks for all your help.

    its still not working.

    i did all the above and yes you are correct in that i moved the agent field lower.

    i copied the code you sent me and i used the link you sent me and it still didn't work.

    what is happening?

    am i correct that i can give people this link:


    then they could click on it and browse the site, then go back to claim now, even though the agend ID will not appear on the link, the agentid should register in the form? this is what i was told above?

    is there no chance of having the agent=11111 for the entire site? ie. regardless of what they click on?



  • Profile Image
    JotForm Support

    Answered by Welvin on March 26, 2017 at 10:35 AM

    It says undefined. The scripts are correct. I will have to consult my colleague regarding this matter. I'll let you know.

    Yes, you are correct. Give the link, people can go to the other pages, come back to the page, the script will automatically put the value (agent ID) in the field without the need to append the parameter.

  • Profile Image
    JotForm Support

    Answered by Mike on March 26, 2017 at 02:00 PM

    The Agent word should start from the capital letter, so the link will be:


    The navigation through the site should not be a problem.

    Note, that the code will save the value in a browser local storage. If you access the site with another agent ID in the same browser, the new ID will not be saved in your browser (the first stored ID is not changed). However, if you clear the local browser storage, or for example access it in a browser incognito mode, the new ID will be saved. It should not create any issues if you provide your agents with different IDs (links).

  • Profile Image

    Answered by SkyClaim on March 26, 2017 at 04:07 PM

    amazing. i just tried and it's working.


    THANKS SO SO MUCH. Jotform is truly the most impressive and easy to use system.