LeadPages is a popular landing page builder service which allows you to create stunning landing pages to collect leads.

Giving an incentive to your website visitors to signup and spread the word to their friends is a great way to boost your lead generation. This can easily be done with ReferralMagic and LeadPages integration.

Once the visitor signs up to your lead form on your landing page, you will need to display them a refer-to-friend widget. This widget is provided by ReferralMagic and it's easy to add it. Then you will need to track coming in referrals from these invitation links. Below, you can find step by step integration guide for ReferralMagic. and LeadPages.

Step 1: Add tracker javascript

Login to your ReferralMagic account and create your referral campaign if you haven't done yet. On the next step, you will see the installation instructions page. Copy the tracker javascript code:


Login to your LeadPages account and edit your landing page. On the left menu, click "Page Tracking" menu item (1) and switch to "Analytics" tab (2):


Scroll down to the bottom and you will see "Immediately before the closing <body> tag" text field. Paste the javascript code you have just copied from ReferralMagic to this field. Then append the following javascript code to that field:

<script src="<https://code.jquery.com/jquery-2.2.4.min.js>"></script>
	var rfmgc_isSubmittingSignUp = false;
	function rfmgc_handleFormSubmit(e) {
		if (rfmgc_isSubmittingSignUp) { return; }
		rfmgc_isSubmittingSignUp = true;
		var form = jQuery(this).parents('form');
		var email = jQuery('input[type=email]', form).val();

		if (email!='') {
			window.rfmgc('sign-up', {
				email: email

	jQuery(function() {
		jQuery('button[type="submit"]').on('click', rfmgc_handleFormSubmit);
		jQuery('input').on('keydown', function(e) {
			if (e.which === 13) { rfmgc_handleFormSubmit(e) }

Save your landing page.

Step 2: Add refer-to-friend widget

The last step is to add refer-to-friend widget so that your users can copy the invitation link and share it across their circles. The refer-to-friend widget javascript code must be added to the result page where you a unique identifier about your visitor (such as email address).

Login to your ReferralMagic account and go to your referral campaign dashboard. On the right menu, you will see "Widget Setup" menu item. Click on it:


Scroll down on the page and copy the widget code and place it to the target page where you have unique identifier about your visitor (example: email address). If you don't have a unique identifier about your visitor, you can simply use the email address which has been gathered on step 1 javascript code.


That's all. You have successfully added referral tracking system and invite friend widget to your LeadPages powered landing page.

If you need help, feel free to contact us anytime. We will be happy to assist you for LeadPages integration.