Referral link on a thank you page

Last Updated: 22 Feb 2019

What is it good for?

This solution allows to automatically create landing page links that contain a unique user ID. Use of such links allows you to track the landing page referral process by those who filled out the form.


First, add the following code to the “javascript codes” tab, to the main page:

function generateId () {
  return Math.floor(Math.random() * 10000000000);
document.querySelector('.widget-input-button').onclick = function () {
  document.querySelector('[name=user_id]').value = generateId();

Next, add the below code to the conversion page:

document.querySelector('.reflink-area').innerHTML = '' + conversion.user_id;

Please replace the words ‘’ with the URL of a landing page, where you add the above code, e.g. ‘’.

Then go to the editor and create a form on a landing page. The form must contain one hidden field. This field must have a value of ‘Name attribute’ set to ‘user_id.’


Then proceed to the editing of the conversion page. Create a widget (such as a text field) on it and give it the ‘reflink-area’ class. Reflink will appear in this area.


Now it is time to publish the landing page. From this point on, each time after the form has been correctly filled and submitted, a 10 digit user code will be generated, which will be stored in the hidden user_id field and will also be stored in the lead. The same code will also be added to the link that will appear on the conversion page. This link should be used by the subscriber to further recommend the landing page.

Was this article helpful?

Can’t find what you need?

Let us help you!
Send us a message
We are using cookies for analytical purpose. Learn more.