getCrossDomainLinkingUrlParameter

The getCrossDomainLinkingUrlParameter() method returns a query parameter that holds a visitor ID when domains are linked. The default parameter name is pk_vid.

This method works when you use enableCrossDomainLinking().

Syntax

getCrossDomainLinkingUrlParameter()
getCrossDomainLinkingUrlParameter(): Promise<string>
getCrossDomainLinkingUrlParameter(): Promise<string>
getCrossDomainLinkingUrlParameter(): Promise<string>
getCrossDomainLinkingUrlParameter(): Promise<string>
getCrossDomainLinkingUrlParameter(): Promise<string>
getCrossDomainLinkingUrlParameter(): Promise<string>

Returns

A query parameter that holds the visitor ID.

Format: Example: pk_vid=0123456789abcdef0123456789abcdef

Type: string

Examples

To get a query parameter for linked domains:

_paq.push([function () {  
    console.log(this.getCrossDomainLinkingUrlParameter());  
}]);
const domainLinkingUrlParameters = await CrossDomainTracking.getCrossDomainLinkingUrlParameter();
const domainLinkingUrlParameters = await CrossDomainTracking.getCrossDomainLinkingUrlParameter();
const domainLinkingUrlParameters = await CrossDomainTracking.getCrossDomainLinkingUrlParameter();
const domainLinkingUrlParameters = await CrossDomainTracking.getCrossDomainLinkingUrlParameter();
const domainLinkingUrlParameters = await CrossDomainTracking.getCrossDomainLinkingUrlParameter();
const domainLinkingUrlParameters = await CrossDomainTracking.getCrossDomainLinkingUrlParameter();

A sample of the return value:

pk_vid=0123456789abcdef0123456789abcdef

To add a query parameter to links when your application creates links dynamically:

var url = "<http://myotherdomain.com/path/?"> + jstc.getCrossDomainLinkingUrlParameter();  
$element.append('<a href="' + url + '">link</a>');
Not available
Not available
Not available
Not available
Not available
Not available

Related methods