Passing Parameters Through URLs

You can use parameters to pass information through the links to your online customer forms. For example, if you link from partner websites, you can include the partner's name or code in the URL. When you do this, you know the source of the new lead or customer. You can also use parameters when you create links for paid search campaigns.

When a customer follows a link to an online customer form and submits the form, NetSuite creates a new lead, prospect, or customer record. If you include parameters in the link to the form, NetSuite includes this information about the new record. Parameters in the link to the form lets you associate this new record with a campaign or partner.

For example, Wolfe Electronics advertises through banner ads on the internet. Each ad links to an online customer form from their websites. The marketing manager wants to track which ad campaign sends each lead to the form.

The campaign ID for each ad is passed through the link to the online form. When the lead submits Wolfe Electronics’ lead capture form, the campaign is automatically selected on the lead record that NetSuite creates.

You can find a form's URL in the Publishable Form URL field on the External subtab of the online customer form record.

To pass information through a link, you add the information to the end of the publishable form URL. In the example above, the URL might look like this:

          https://system.netsuite.com/app/site/crm/externalleadpage.nl?compid=ACCT000000&formid=1&h=1bdc80a058&leadsource=JoinNowAd 

        

In this sample URL, notice that the first parameter in a URL begins with a question mark (?). Each parameter after the first begins with an ampersand (&). Most URLs include parameters by default. In this example, there are parameters referring to the NetSuite company ID, and the online form's ID.

Note:

Spaces in parameters should be replaced with %20.

The table below lists the parameters you can use to automatically insert information into an online customer form.

Field

Parameter

Campaign Event***

&campaignevent=187

Company Name

&companyname=Global%20Distributing,%20Inc.

City

&city=New%20York

Country

&country=USA

Custom Form

&customform=New%20Lead%20Form

E-mail

&email=john@example.com

Lead Source

&leadsource=Spring%20Ad%20Campaign

Login Password

&password=password

Partner**

&partner=Universal%20Consulting

Partner Code**

&partner=1111

Phone Number

&phone=555-555-5554

Promotion

&promocode=Feb%20Flyer

State

&state=New%20York

Zip/Postal Code

&zip=54321

* The &customform parameter determines which lead, prospect, or customer entry form is used when editing or viewing the record you create.

**The &partner parameter is used to pass both partner names and partner codes.

***The &campaignevent parameter determines which event is associated to the customer entry form. The value of this parameter is the internal ID of the campaign event.

If a partner's site links to your online customer form, you might want the partner field to show the name of the partner. To do this you would create a link to the URL that would look like this:

            https://sample.online.customer.form.com?partner=Partner%20Name 

          

When a lead clicks the link to your online customer form on the partner's web page, the lead transfers to your online customer form. The Partner field has the partner's name automatically entered.

If you link to online customer forms in NetSuite, you can pass information into custom fields about the person navigating to the form. For example, you could pass this information when linking to a custom record form from your Customer Center.

The internal form URL from the External subtab of the online form record lets you add any of the parameters in the table below.

Info

Parameter

name

{name}

login email address

{email}

first name

{firstname}

last name

{lastname}

internal ID

{user}

internal ID of user's role

{role}

Each parameter must be enclosed in brackets, { and }. If you want to pass the user's name and email address to a form, the link could look like this:

          /app/crm/common/onlineforms/ internalonlineform.nl?formid=100&custrecord123={name}&custrecord124 ={email} 

        

For more information about online customer forms, see Creating an Online Customer Form.

For information about how to set the Subsidiary field on online customer forms, see Set Subsidiaries on Online Forms in OneWorld.

You can also embed the online form in your website so that the customer never leaves your website when they use that form. For more information, see Embedding an Online Form in your Website Page.

Custom Field Parameters

You can create custom entity fields that you can use to track information that is specific to your business. Custom entity fields can be included in online customer forms.

A marketing manager creates a custom check box field called Product Trial Candidate to identify leads willing to test new products. When a lead clicks the link to "try New Products – Free!”, they move to an online lead capture form. The Product Trial Candidate box is checked on the online form, and on the lead record NetSuite creates when the lead submits the form.

If you want to pass custom field information into your online lead capture forms, first determine the custom field ID. It is in the ID field on the custom field record. A URL with custom field parameters should follow this format:

          https://system.netsuite.com/app/site/crm/externalleadpage.nl?compid=ACCT000000&formid=1&h=1bdc80a058&custentity1=industryperiodical 

        

Custom check box fields follow the following format:

          https://system.netsuite.com/app/site/crm/externalleadpage.nl?compid=ACCT000000&formid=1&h=1bdc80a058 &custentity2=T 

        

If you want the check box marked, set the parameter to T in the URL. To clear the check box, pass F through the URL.

For more information about creating custom fields, see the SuiteBuilder user guide.

Passing Parameters from Third Party Sites

If NetSuite does not host your site, you must include Javascript in the code of your web pages. Javascript enables parameters to pass to any online customer forms you link to.

The following Javascript code must be placed at the bottom of each page in your website. It should not be placed inside any HTML tags and should be the last code before the </body> tag.

          <script type="text/javascript">
<!--
function getNS_url_param( name ){ 
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
var regexS = "[\\?&]"+name+"=([^&#]*)";  
var regex = new RegExp( regexS );  
var results = regex.exec( window.location.href );  
if( results == null )    
return "";  
else    
return results[1];
}
function trackNSParams() {
var name = 'leadsource';
var value = getNS_url_param(name);
if (value != null && value.length > 0)   
document.cookie = name+"="+value+"; path=/";
}
function appendNSParams(url) {
var nameEQ = "leadsource=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0 ) 
      url = url + '&' + nameEQ + c.substring(nameEQ.length,c.length);
}
return url;
}
// -->
trackNSParams();
</script> 

        

Then apply the following format to any links to online forms from your site (for example, Contact Us links):

          <a href="#" onclick="document.location.href=appendNSParams(Publishable Form URL)">Contact Us
</a> 

        

Paste the publishable form URL for the online customer form between the parentheses. For example:

          <a href="#" onclick="document.location.href=appendNSParams(https://forms.netsuite.com/app/site/crm/externalleadpage.nl?compid=1234567&formid=3&h=ed62a43be13c70de335b)">Contact Us
</a> 

        

When copying and pasting the form ULR, ensure that the single and double quotes are pasted properly. If necessary, you might need to retype the quotes.

For more information about URL Parameters, see Tips for Passing Parameters Through URLs and Website URL Parameters

Related Topics

Online Customer Forms
Creating an Online Customer Form
Tips for Passing Parameters Through URLs

General Notices