setVisitorIdFromDeepLink

The setVisitorIdFromDeepLink() method sets the visitor ID from the pk_vid parameter in a deep link URL. Use this method to link a website visitor to an app visitor.

Syntax

await FlutterPiwikPro.sharedInstance.setVisitorIdFromDeepLink(deepLink);

Parameters

deepLink (string, required)

The deep link URL containing the pk_vid query parameter.

The pk_vid value must:

  • Be at least 16 characters long.
  • Be a valid hexadecimal string.

Only the first 16 characters are used.

Returns

Whether the visitor ID was set successfully.

Type: boolean.

  • true: The visitor ID was set.
  • false: The visitor ID wasn't set because the parameter is missing, the format is invalid, or the input is empty.

Examples

To set the visitor ID from a deep link URL:

final bool ok = await FlutterPiwikPro.sharedInstance
    .setVisitorIdFromDeepLink('https://example.com?pk_vid=0123456789abcdef');

Related methods