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

    How to add affiliate java script code in thank you page?

    Asked by usre on June 16, 2017 at 04:30 AM

    Dear support!

    I would like to have a thank you page, which is shown after submitting a form like



    For tracking of an affiliate network, this thank you page shold execute this script (example code)



    (function (w, d, namespace, domain, progId, tagId, undefined) {

    w[namespace] = w[namespace] || {}; var act = w[namespace], payload = [];

    act.tags = act.tags || []; act.tags.push(tagId, payload);

    var protocol = d.location.protocol;


    // Start: fixed parameters – don’t change!

    module: 'OrderTracking',

    event: 'Lead',

    // End: fixed parameters

    // Start: mandatory payload parameters – please edit

    order_id: 'AE25125346532',

    rate_number: 3,

    // End: mandatory payload parameters

    // Start: optional payload parameters – please edit

    currency: 'EUR',

    lmulti: 4,

    net_price: 0.42,

    order_description: 'test_order_123',

    product_ids: ['product1', 'product2', 'product3'],

    program_subid1: 'advertiser_subid_1',

    program_subid2: 'advertiser_subid_2',

    voucher_code: 'test_vouchercode',

    // Start: parameters for server sided tracking only

    ad_number: 6,

    ad_type: 4,

    click_time: '2014-10-05T11:13:01',

    date_format: 'yyyy-MM-ddTHH:mm:ss',

    order_date: '2014-11-03T18:12:13',

    publisher_id: 123,

    publisher_subid: 'test_subid',

    time_zone: '+1',

    uid: '1657A2C9-6764-4BF8-B5DE-5B2D1FFC1631'

    // End: optional payload parameters


    if (act.get === undefined) {

    var s = d.createElement('script');

    s.type = 'text/javascript';

    s.src = protocol + '//' + domain + '/' + 'affadvc.aspx?ns=' +

    namespace + '&dm=' + domain + '&site=' + progId + '&tag=' + tagId;

    s.async = false; // always keep false for OrderTracking

    (d.getElementsByTagName('body')[0] ||


    }else { act.get(w, d, progId, tagId); }

    })(window, document,

    // Start: configuration parameters

    'aff_act_1.0', 'webmasterplan.com', PROGRAMID, 'TAG-ID-1');

    // End: configuration parameters



    <img src="https://partners.webmasterplan.com/







    05T11:13:01&uid=1657A2C9-6764-4BF8-B5DE-5B2D1FFC1631&net_price=0.42" />





    I've copied this script to my thank you page at https://form.jotformeu.com/71662081278358,

    but the javascript is discarded immediately and I can't find the noscript code in the thank you page

    (after submitting and displaying the source code of the thank you page)


    Can you please help?

    Thanks a lot!


    Page URL:

  • Profile Image
    JotForm Support

    Answered by ashwin_d on June 16, 2017 at 05:06 AM

    Hello usre,

    Please note that for security reasons, it is not possible to add any scripting code in form or thank you message. If you add any script code in form, it will be deleted immediately. 

    The best way to achieve your requirement is to create a new page in your website, add your script code in that page. You can use this as the thank you page URL of your JotForm. You may like to take a look at the following guide on how to redirect users to your own page:  https://www.jotform.com/help/38-Redirecting-Users-to-a-Different-Page

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!