Connect your Customer login form to Referral DashboardLast Updated: May 06, 2019
Connect your Customer login form to Referral Dashboard
Here is how to connect your customer login (or signup) form to their referral dashboard. This will pass the customer details into your referral campaign as a new customer invite if customer is not already invited to your campaign.
You need to make few updates to our script code before making it live on your website. You need to change the Email field name, Name field name, your lead form name, your license key and your campaign id. Instructions are as follows for making these changes.
1. FORM NAME
Right click on your lead form and choose "Inspect element" to find your Form HTML. Then look for "name=" in the form tag. If "name=" is not available, then look for "id=". If that's not available either then look for "class=" as shown below.
Depending on what you have, you can use one of the three options. Copy, make the required replacement and then replace 'form-identifier' on the main script code with the selection.
//Use the following as your 'FORM-IDENTIFIER' if your form has name. Replace the "form-name" below with your actual form name. Keep the quotes (""). 'form[name="form-name"]' //Use the following as your 'FORM-IDENTIFIER' if your form has no name but has an ID. Replace the form-id below with your actual form id. Keep the #. '#form-id' //Use the following as your 'FORM-IDENTIFIER' if your form has no name and no ID but has a css class name. Replace the form-class-name below with your actual form class name. Keep the dot (.). '.form-class-name'
In our example we are using form name as the tag: name="gform_1"
Copy and paste the form name (or id or class) between the quotes, so in this example you would need to copy gform_1 and replace it into correct script line as identified above. Then copy it and replace it in the script code below to replace our default 'form-identifier'.
Use the "Inspect element" feature in Firefox or Chrome to find your form field names.
2. NAME FIELD
Place your cursor into the name field of your lead form, right click and choose "Inspect element".
Look for "name=" as shown in the above screenshot. Copy and paste the field name between the quotes, so in this example you would need to copy et_pb_contact_your_name_0 and paste it into the script below to replace our default "name". Do not delete the quotes in our script.
3. EMAIL FIELD
Place your cursor into the email field of your lead form, right click and choose "Inspect element".
Look for "name=" as shown in the above screenshot. Copy and paste the field name between the quotes, so in this example you would need to copy et_pb_contact_your_email_0 and paste it into the script below to replace our default "useremail_field_name". Do not delete the quotes in our script.
4. CHANGE LICENSE KEY AND CAMPAIGN ID
Finally, you need to change the license key and the campaign ID in our script as shown in the below screenshot.
You can find you License Key and Campaign ID by logging into your iRefer account and going to your campaign settings.
Then click on API guide > Overview as shown below.
Copy and paste this script along with the above changes into the same page as your form or login button.
You can remove or comment out the name section of Get User-name and name cookies, if you are not using user name (prefix each line with //).