setVisitorIdFromDeepLink

The setVisitorIdFromDeepLink() method sets the visitor ID from a deep link URL containing the pk_vid parameter. This enables cross-platform visitor identification when a user opens your app through a deep link.

Syntax

await PiwikProSdk.setVisitorIdFromDeepLink(deepLink);

Parameters

deepLink (string, required)

The deep link URL containing the pk_vid parameter.

Returns

Whether the visitor ID was successfully set.

  • true if the visitor ID was set
  • false if the visitor ID wasn’t set or there was nothing to set

Type: boolean

Examples

To set the visitor ID from a deep link:

const isSet = await PiwikProSdk.setVisitorIdFromDeepLink('https://example.com?pk_vid=0123456789abcdef');

Related methods