Tag Builder - Additional Onsite Domains

Description

A link is considered onsite if the host portion of its URL matches the domain of its containing page. If the host does not match, then a link is considered offsite. The link is always compared against the domain of the page that contains it. The Additional Onsite Domains field allows you to specify additional domains to compare. This is useful when the JavaScript tag is shared across multiple domains and/or subdomains.

By default the Additional Onsite Domains field contains a comma separated list of domain names. Each domain name is compared against the host property of the event object.

As an option, the Regular Expression check box can be selected. If selected, the onsite domain names field contains a regular expression pattern. The regular expression pattern is matched against the host property of the event object. More information here.

In both cases, the comparison case insensitive.

The Download and Anchor link handlers require onsite links. The Offsite link handler requires an offsite link. These handlers call the function isOnSite to determine whether a link is onsite or not.

Examples

Suppose you load the following page into your browser:
http://www.webtrends.com/products.aspx

  • Onsite and Offsite Links
  • Suppose the page contains the following links:

    1. <a href="http://www.webtrends.com/SmartSource/smartsource.xls">SmartSource Spreadsheet</a>
    2. <a href="http://www.wikipedia.org/wiki/Web_analytics">Wikipedia</a>

    The first link is onsite because its domain (www.webtrends.com) matches that of the containing page. The second link is offsite because its domain (www.wikipedia.org) does not match that of the containing page.

  • Comma Separated List and Regular Expression
  • Suppose the page contains the following links:

    1. <a href="http://www.ondemand.webtrends.com/wrc/bin/WebTrendsReportingCenter">WTRC</a>
    2. <a href="http://www.product.webtrends.com/products/ml2.aspx">ML2</a>

    These are offsite links because their domains (ondemand.webtrends.com and product.webtrends.com) do not match that of the containing page (www.webtrends.com). To make these onsite links, you can use either a comma separated list, or a regular expression.

    • Comma Separated List - Place the following in the Additional Onsite Domains field:
    • www.ondemand.webtrends.com,www.product.webtrends.com
    • Regular Expression - Place the following in the Additional Onsite Domains field (and enable the RegExp check box):
    • .*webtrends\.com

JavaScript Reference

Class.PropertyType
WebTrends.onsitedomsstring or RegExp