Request Attributes

You can create attribute tags for website properties that aren't shown on NetSuite records, like elements from browser requests when shoppers visit your site. For example, you can use the Attribute tag below to capture cookies from visitors to your site:

          <%=getCurrentAttribute('request','cookies')%> 

        
Note:

When using request attributes, also use nlescapehtml in your attribute tag to avoid cross-site scripting vulnerabilities. This additional parameter is most commonly used along with the querystring attribute. For more information see, Specifying Information for Display.

Site Properties

Attribute

Notes

Cookies associated with the current page

cookies

 

IP Address for the session

ipaddress

 

Referrer to the current page

referrer

 

Scheme of current page (http or https)

scheme

Use this attribute to create secure links. For more information, see Creating Secure Links.

URL parameters of the current page

querystring

 

User Agent HTTP header

useragent

Returns the visitor's browser type and version.

Creating Secure Links

When you show an image on your site that links to another site, you must use a full URL. If you use a non-secure URL (one that starts with HTTP as opposed to HTTPS) on a checkout page, visitors might see a popup warning about “nonsecure items.” To avoid this warning, use an Attribute tag to build a link that returns HTTP or HTTPS as needed. For example:

          <%=getCurrentAttribute('request', 'scheme')%>://www.othersite.com/file.ext 

        

You can use this tag in a website template, and the resulting URL will always be a fully qualified URL appropriate for the page on which it displays, HTTP for shopping pages, and HTTPS for checkout pages:

http://www.othersite.com/file.ext

https://www.othersite.com/file.ext

Related Topics

General Notices