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 in links for paid search campaigns.

When a customer clicks a link to an online form and submits it, NetSuite creates a new lead, prospect, or customer record. If you include parameters in the link, NetSuite adds that info to the new record, so you can link it to a campaign or partner.

For example, Wolfe Electronics advertises through banner ads online. Each ad links to an online customer form on their website. 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, 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 their name. To do this, you can create a link in this format:

            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, they are taken to your online customer form. The Partner field is filled in automatically.

If you link to online customer forms in NetSuite, you can pass information into custom fields about the person filling out 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 Subsidiaries on Online Customer 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 to track information specific to your business. You can include these fields in online customer forms.

A marketing manager creates a custom box field called Product Trial Candidate to find leads willing to test new products. When a lead clicks the link to "Try New Products – Free!", they're taken to an online lead capture form. The Product Trial Candidate box is checked on the form and on the lead record NetSuite creates when the form is submitted.

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 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 box marked, set the parameter to T in the URL. To clear the box, use F through the URL.

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

Passing Parameters from Third Party Sites

If NetSuite doesn't host your site, you'll need to add JavaScript to your web pages. This lets you pass parameters 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 you copy and paste the form URL, make sure the single and double quotes are correct. If needed, you might have to retype the quotes.

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

Related Topics

General Notices