Anchor Links
  • 06 May 2020
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Anchor Links

  • Dark
    Light
  • PDF

Article summary

Metadata_End

Anchor links are hyperlinks whose URL contains: An anchor (URL followed by hash mark "#" followed by fragment identifier) or a hostname from the onsitedoms array.

If enabled, an event handler function is added for all links that are Anchors. The onsitedoms array is a comma-separated list of file domain names or a regular expression, which is used to determine if a link is "on domain".

Example

Suppose the onsite domain field contains:
"localhost,webtrends.corp"

Page contains the following named link:

<a name=TopOfPage>Top of Page</a>

Page contains the following hyperlink:

<a href="#TopOfPage">Go to top</a>

Clicking the link generates the following parameters:

DCS.dcssip=tagbuilder.webtrends.com
DCS.dcsuri=/Help/EventTracking/Anchor.aspx#TopOfPage
WT.ti=Anchor:#TopOfPage
WT.dl=21

Defining the onsitedoms parameter

The onsitedoms config parameter allows you to define what domains will be considered "on domain". For example, if you want to track off-site links from the product site yourcompanyshopping.com, and you enable off-site link tracking, you can ensure that links to your branding site continue to be tracked as on-site links by setting the onsitedoms config parameter to yourcompanyshopping.com,yourbrand.com.

JavaScript Example:

window.webtrendsAsyncInit = function () {
        var dcs = new Webtrends.dcs();
        dcs.init( {
                dcsid: "dcs12345610000wocrvqy1nqm_123p",
                anchor : true,
                onsitedoms:"webtrends.com,webtrendssupport.com"
        });
        dcs.track();
        }


JavaScript Reference:

dcsMultiTrack ParameterValue
WT.ti21
WT.dldownload: true
WT.nvEnclosing element id or classname (if present)
DCS.dcssiphostname
DCS.dcsuripathname or "/"

Was this article helpful?

What's Next